Skip to content

gitlab-ci : 'changes' keyword in 'rules' is not parsed when pushing a new branch

Summary

'changes' keyword in 'rules' is not parsed when creating a new branch

Steps to reproduce

  1. Merge these 'rules' in the main branch of your repository:
  rules:
    - changes:
        - tst/**/*

or

  rules:
    - changes:
        - README.md

or

  rules:
    - if: $CI_PIPELINE_SOURCE == "push"
      changes:
        - README.md
  1. Create and push a new branch via WebUI or locally from the main branch updated. Branch can have modifications (not the file specified in the rule) or not

Example Project

What is the current bug behavior?

When creating a new branch, the jobs with these rules are executed

Note: this bug appear only when pushing a new branch on the server. If the branch already exists, the rule works correctly

What is the expected correct behavior?

When pushing a new branch on the server, the rule must be parsed

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

GitLab version used: 14.10.1

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

typebug

Edited by Xehanort