Limit CI duplication when doing a push and a tag

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

  • Close this issue

Description

When a tag is pushed, GitLab should check the CI definitions and figure out if there are jobs with the following constraints:

  1. Restricted to only: tags or

  2. Making use of variables that indicate tag name (e.g. CI_COMMIT_REF_NAME, CI_COMMIT_TAG).

If there are no such constrained jobs, there is no need to launch a new build for the pushed tag. Artifacts from the associated commit's build can be reused as is.

If there are constrained jobs, any prerequisite job that is not constrained directly or indirectly (i.e. through dependency) could be skipped; artifacts from the associated commit's job could be reused (provided its artifacts have not expired). All remaining jobs would be relaunched.

Of course, the CI might call a script that uses CI_COMMIT_REF_NAME or CI_COMMIT_TAG, without GitLab knowing about it. Perhaps there should also be a way of manually indicating in .gitlab-ci.yml which jobs have an implicit dependency on the current tag name?

Links / references

https://gitlab.zendesk.com/agent/tickets/97014

Edited Aug 28, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading