Unclear syntax when using rules with changes and manual/scheduled pipelines
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Problem to solve
If you want to set a pipeline to not run when there are changes to a certain file, but still run when it is triggered manually or through a schedule, you need to jump through strange hoops to make it do the right thing:
- if: '$CI_COMMIT_BEFORE_SHA != "0000000000000000000000000000000000000000"'
changes:
- "po/*.po"
when: never
- when: always
What this does is check the if BEFORE_SHA is empty (all those zeros) in addition to checking the changes. Without including that if clause, on a manual or scheduled pipeline (amongst other push types I'm sure) it resolves to true and skips that job, which is clearly not what the user wants.
There should be some kind of helper to do this for you so you don't need that magic invocation with all those zeros. Or at least that magic invocation should be documented as it isn't today.