Skip to content
GitLab
Next
    • Why GitLab
    • Pricing
    • Contact Sales
    • Explore
  • Why GitLab
  • Pricing
  • Contact Sales
  • Explore
  • Sign in
  • Get free trial
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #283881

Backend: Support variables in rules:exists

This is a companion to #34272 (comment 423079375) in order to support rules:exits

Release notes

The longer your gitlab-ci.yml scripts are, the more difficult they are to maintain and scale. By adding support for environment variables in the rules: exists keyword, you can now use variables for paths or filenames without making your CI file overly verbose. Variables help you reduce your configuration file's overall length when running the same CI jobs to test changes in different file sets.

Problem to solve

I have some CI jobs which run the same steps on different files. GitLab does not currently evaluate variables in rules:exists.

Example

rule_exist_job:
 stage: rule-exist
 script: echo "it works!"
 rules:
    exists:
     - $EXIST_PATH

Proposal

Support variable use in the rules:exists clause

Edited Oct 06, 2022 by Laura Montemayor
Assignee
Assign to
Time tracking