Support variables in rules: exists
What does this MR do and why?
Support variable expansion in rules: exists
. This change is under the feature flag ci_variable_expansion_in_rules_exists
.
Screenshots or screen recordings
When the rules match:
variables:
PATTERN: '*.yml'
WRONG_PATH: 'wrong.rb'
rule_exist_job:
script:
- echo $PATTERN
- echo $WRONG_PATH
- echo $EXIST_PATH
rules:
- exists:
- $PATTERN
In the example above, we have an existing deploy.yml
file, so the rule_exist_job
runs:
When the rules do not match:
variables:
PATTERN: '*.yml'
EXIST_PATH: 'upload.yml'
WRONG_PATH: 'wrong.rb'
rule_exist_job:
script:
- echo $PATTERN
- echo $WRONG_PATH
- echo $EXIST_PATH
rules:
- exists:
- $PATTERN
There are no jobs for this pipeline:
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to: #283881 (closed)
Rollout issue: #381046 (closed)
Edited by Laura Montemayor