Backend: Include schema error with both "inputs" and "rules"
Summary
I'm using Gitlab CICD include:project and include:rules feature.
It works great in this configuration:
.gitlab-ci.yml
include:
- project: 'project/templates/gitlab'
ref: main
file: 'lint/docker.yml'
inputs:
stage: lint
rules:
- changes:
paths:
- Dockerfile
lint/docker.yml
spec:
inputs:
stage:
description: "The running job stage"
---
lint:hadolint:
stage: $[[ inputs.stage ]]
script:
- hadolint Dockerfile
However if I add an if condition (the same as documented) I get a pipeline schema error: "This GitLab CI configuration is invalid: include:include config contains unknown keys: inputs."
.gitlab-ci.yml
include:
- project: 'project/templates/gitlab'
ref: main
file: 'lint/docker.yml'
inputs:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
paths:
- Dockerfile
I'm running GitLab Enterprise Edition v16.6.1-ee.
Steps to reproduce
Try to import jobs from another project using both [include:inputs]
and [include:rules:if]
.
What is the current bug behavior?
Cannot include file based on conditions such as $CI_PIPELINE_SOURCE == "merge_request_event"
.
What is the expected correct behavior?
If condition should not raise an error.
Edited by Ghost User