Conditionally selecting stages in gitlab-ci

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

  • Close this issue

Problem to solve

We have a rather complicated gitlab-ci setup which has a list of about 15 stages. However, we also have a case where we want to launch nightly schedules. Rather than having to do:

except:
  - schedules
....
only:
  - schedules

all over the place, it would be more convenient for our gitlab-ci yaml file to have something like:

stages:
  schedules: 
    - stage4
    - stage5
    - stage7
  branches:
  tags: # or some way to combine these two?
    - stage1
    - stage2
    - stage3
    - stage4
    - stage5
    - stage6
    - stage7

This would help keep our yml files much cleaner and easier to determine what runs what.

Intended users

Developers

Further details

Cleaner and faster yaml configurations

Proposal

Not sure - was hoping for some feedback on the above, assuming it's not already possible

Links / references

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