Global `only` and `except` settings in Gitlab CI
Problem to solve
When having jobs that should only be ran as a tag push you currently need to add only
or except
to exclude tags from all of the other jobs. It would be good to have global only
and except
settings that can be overridden at the job level.
Further details
There are 2 open issues around adding a global tags
block at https://gitlab.com/gitlab-org/gitlab-ce/issues/38480 and https://gitlab.com/gitlab-org/gitlab-ce/issues/23434 but I can't see one about the only
and except
settings.
The same issues discussed potentially apply where someone might have created jobs called only
and except
which would conflict. Because only
, except
and tags
are all lists rather than maps (as jobs are) then it should be detectable. Should probably also warn people not to name jobs like these because of the name collision.
Proposal
What does success look like, and how can we measure that?
A global only
and except
makes it easier to manage Gitlab CI files that have actions that trigger only on tags or other specific use cases.