Update Pipeline Notes authored by Slominski, Ryan's avatar Slominski, Ryan
...@@ -33,7 +33,7 @@ git push --tags - ...@@ -33,7 +33,7 @@ git push --tags -
There is a feature to provide a group default `.gitlab-ci.yml` if none is provided in a project. We may consider doing this at some point. There is a feature to provide a group default `.gitlab-ci.yml` if none is provided in a project. We may consider doing this at some point.
# Trigger Rules # Trigger Rules
By default if you don't define any rules your job will run on any push (with file changes, possibly excluding push with just tags). One tricky scenario to be aware of is trying to avoid triggering a CI job when a push contains a change to only the README, CHANGELOG, Screenshot, or similar file. You might think this would work, but it doesn't: By default if you don't define any rules your job will run on any push. One tricky scenario to be aware of is trying to avoid triggering a CI job when a push contains a change to only the README, CHANGELOG, Screenshot, or similar file. You might think this would work, but it doesn't:
``` ```
rule: rule:
- changes: - changes:
...@@ -45,4 +45,6 @@ rule: ...@@ -45,4 +45,6 @@ rule:
``` ```
This doesn't work because changes are evaluated by looking for any file matches, and means if you have a commit with multiple files, some of which match and some of which are actual code files, this rule will prevent CI. Not what you want. This doesn't work because changes are evaluated by looking for any file matches, and means if you have a commit with multiple files, some of which match and some of which are actual code files, this rule will prevent CI. Not what you want.
*Note*: pushing just a tag is a similar scenario, and it is similarly difficult to avoid CI as it's not easy to indicate skip only if the push contains just a tag and nothing else.
There are [complicated work-arounds](https://stackoverflow.com/questions/73298609/suppress-gitlab-ci-stage-if-push-only-changes-readme-md). A better solution may be to simply manually include `[ci skip]` in the commit message of changes you want to skip CI on. Alternatively, you can use `git push -o ci.skip`, which works even if there is no commit message (such as when pushing a tag). There are [complicated work-arounds](https://stackoverflow.com/questions/73298609/suppress-gitlab-ci-stage-if-push-only-changes-readme-md). A better solution may be to simply manually include `[ci skip]` in the commit message of changes you want to skip CI on. Alternatively, you can use `git push -o ci.skip`, which works even if there is no commit message (such as when pushing a tag).