Open
Description
Preface
GitLab !reference
support was added in #112 but there are still some edge cases.
How I verified that there are no duplicate issues in the issue tracker
I searched for the "reference" word between open and closed issues and I found only closed #112.
.pre-commit-config.yaml
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.23.1
hooks:
- id: check-gitlab-ci
args: ["--data-transform", "gitlab-ci"]
Valid .gitlab-ci.yml
include:
- project: "myproject/mynamespace/backend/repositoryname"
ref: v1.1.22
file: ".gitlab-ci-common.yml"
test:
stage: test
services:
- name: mongo:6.0.6
command: ["/bin/sh", "-c", "mongod --logpath /dev/null --bind_ip_all --replSet 'rs0' "]
- !reference [.common_services_for_test_job, services]
before_script:
- echo "Hello"
check-gitlab-ci
output
Validate GitLab CI config................................................
Failed
- hook id: check-gitlab-ci
- exit code: 1
Schema validation errors were encountered.
.gitlab-ci.yml::$.test.services[1]: ['.common_services_for_test_job', 'services'] is not valid under any of the given schemas
Underlying errors caused this.
Best Match:
$.test.services[1]: ['.common_services_for_test_job', 'services'] is not of type 'string'
Expected result
Accept the mentioned YAML syntax.