rules:changes does not work for force pushes in branch pipelines
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
This issue is related to #293645 (closed) but describes an additional bug:
When force pushing a branch with changes that should trigger jobs according to rules/changes, this job is not triggered.
Steps to reproduce
- Create a project with a CI job containing
ruleswithchanges. - Create a branch with changes to a file that should trigger the rule and push
- Modify the commit so that it should still trigger the rule and push
- Observe that the job with the rules is not triggered
Example Project
See three last pipelines in https://gitlab.com/mlegner/test/-/pipelines (in particular https://gitlab.com/mlegner/test/-/pipelines/442777096).
What is the current bug behavior?
CI containing rules with changes are not triggered when force-pushing a branch with changes to the corresponding files.
What is the expected correct behavior?
CI containing rules with changes are triggered when force-pushing a branch with changes to the corresponding files.
Relevant logs and/or screenshots
| First commit | Second commit | Force push |
|---|---|---|
![]() |
![]() |
![]() |
- First commit triggers all jobs irrespective of changes (see #293645 (closed))
- Second commit works as intended
- Force push does not trigger pipeline with rules even though there are changes to the corresponding file
Output of checks
This bug happens on GitLab.com
Edited by 🤖 GitLab Bot 🤖


