Manual pipeline variables bypasses "changes:" rule
Summary
Custom variables passed via
Steps to reproduce
- Create
.gitlab-ci.yml
file with the following content:
stages:
- test
job1:
stage: test
script:
- echo $VAR1
- if [[ "$VAR1" == "job1" || "$VAR1" == "" ]]; then echo "if is true"; else echo "if is false"; fi; exit 0;
rules:
- changes:
- "file1.txt"
-
Create a
file1.txt
-
Go to
CI/CD > Pipelines
and click "rune pipeline" -
Specify any variable with any value and run
Example Project
https://gitlab.com/gitlab-gold/asalii/custom_variables_and_rules
What is the current bug behavior?
The job will be included to the pipeline ignoring the "changes" rule
What is the expected correct behavior?
The job should not be included to the pipeline
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Edited by Artur Salii