Avoid additional pipeline run when creating new tags in a pipeline
Description
We are using semantic versioning, specifically an automated system based on commit messaged. Part of our CI pipeline is to calculate the newest version and label all build artifacts with it, so that we know the exact version being deployed. We also want to tag the commit so that we can easily tie a specific artifact in production back to a commit. The problem is that this means doing a git tag
followed by git push
in the pipeline, which of course triggers another build, potentially in an endless cycle. It is possible to exclude tags form triggering builds using except
in the .gitlab-ci.yml
file, but this in only at a build level, not a pipeline level, and it still results in two pipelines being reported for every commit.
Proposal
Add a project level way of excluding tags from triggering builds, either via .gitlab-ci.yml
or through the UI. Using .gitlab-ci.yml
would suggest that a pipeline still needs to be created though, which ideally should not be the case. The documentation suggests that it should also be possible to skip CI by using [skip ci]
in the commit message, but this doesn't work for tags (e.g. git tag --annotate v1.0.0 --message "[skip ci]"
). If this were changed, it would probably still involve a skipped
pipeline being created though.