1
0
Fork 0

fix(rules/gitlab): handle include

This commit is contained in:
ssube 2019-11-11 19:26:45 -06:00
parent e0ec508fc5
commit b84e7b80c6
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 22 additions and 10 deletions

View File

@ -51,6 +51,8 @@ rules:
type: object
image:
type: string
include:
type: array
services:
type: array
stages:
@ -77,7 +79,7 @@ rules:
type: string
- name: gitlab-top-level
desc: should only have jobs and stages at the top level scope
desc: should only have includes and stages at the top level scope
level: info
tags:
- gitlab
@ -85,12 +87,22 @@ rules:
check:
type: object
not:
anyOf:
- required: [image]
- required: [services]
- required: [types]
- required: [before_script]
- required: [after_script]
- required: [variables]
- required: [cache]
allOf:
- properties:
include:
type: array
items:
type: object
stages:
type: array
items:
type: string
- not:
anyOf:
- required: [image]
- required: [services]
- required: [types]
- required: [before_script]
- required: [after_script]
- required: [variables]
- required: [cache]