workflow:rules:changes no longer trigger pipelines
Update - workaround
Until we'll fix this regression there is a workaround by adding path key to changes
Summary
Pipelines are no longer triggered when the block workflow:rules:changes is present in the .gitlab-ci.yml file. This is a regression. The sample project used in "steps to reproduce" is just a simplified version of the issue we are encountering in our projects, containing more complex .gitlab-ci.yml workflows.
Tickets
- https://gitlab.zendesk.com/agent/tickets/305782
- https://gitlab.zendesk.com/agent/tickets/305761
- https://gitlab.zendesk.com/agent/tickets/305540
- https://gitlab.zendesk.com/agent/tickets/305551
- https://gitlab.zendesk.com/agent/tickets/305583
- https://gitlab.zendesk.com/agent/tickets/305868
Steps to reproduce
- Create blank project in GitLab
- Go to CI/CD > Pipelines and use "Try test template"
- New pipeline is created
- Modify the .gitlab-ci.yml file and add the following block. Commit.
workflow:
rules:
- if: $CI_COMMIT_BRANCH =~ /^(main)$/i
changes:
- .gitlab-ci.yml
when: always
- when: never
- New pipeline is not created
- Modify the .gitlab-ci.yml file and comment the changes block. Commit
workflow:
rules:
- if: $CI_COMMIT_BRANCH =~ /^(main)$/i
#changes:
# - .gitlab-ci.yml
when: always
- when: never
- New pipeline is created
Example Project
Use the above steps on a blank GitLab project
What is the current bug behaviour?
Pipeline is not triggered when files that should trigger it are modified
What is the expected correct behaviour?
Pipeline should be triggered when files that should trigger it are modified
Relevant logs and/or screenshots
N/A
Output of checks
GitLab.com, GitLab Enterprise Edition 15.2.0-pre 9d9a7c86
Workarounds
- Temporarily comment out or remove
workflow:rules:changes - Running the pipeline manually from
CI/CD > Pipeline. This does not apply when pipeline should be triggered on merge requests, in this case we have a merge request that waits for the pipeline indefinitely.
Edited by Dov Hershkovitch