Skip to content

Instantly share code, notes, and snippets.

@schnell18
Created June 9, 2022 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save schnell18/a2fe4e9937a0ee472f8641f96a632172 to your computer and use it in GitHub Desktop.
Save schnell18/a2fe4e9937a0ee472f8641f96a632172 to your computer and use it in GitHub Desktop.
Gitlab pipeline quirk
Jobs or pipelines run unexpectedly when using changes:
You might have jobs or pipelines that run unexpectedly when using rules: changes
or only: changes without
merge request pipelines.
Pipelines on branches or tags that don't have an explicit association with a merge request
use a previous SHA to calculate the diff. This calculation is equivalent to git diff HEAD~
and can cause unexpected behavior, including:
The changes rule always evaluates to true when pushing a new branch or a new tag to GitLab.
When pushing a new commit, the changed files are calculated by using the previous commit
as the base SHA.
Additionally, rules with changes always evaluate as true in scheduled pipelines.
All files are considered to have changed when a scheduled pipeline runs, so jobs
might always be added to scheduled pipelines that use changes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment