CI_MERGE_REQUEST_LABELS environment variable not explosed in "stop jobs"

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

  • Close this issue

Summary

As per the title

Steps to reproduce

  • configure a stop job configuration designed to stop on branch deletion as described here

  • add a rule like this to the start and stop jobs:

    - if: $CI_MERGE_REQUEST_LABELS && ($CI_MERGE_REQUEST_LABELS =~ "some label")
      when: never

What is the current bug behavior?

The CI_MERGE_REQUEST_LABELS is not exposed in the stop job, for neither detached nor merge_results pipelines.

Noteworthy is that other CI_MERGE_REQUEST_* variables seem to be present

What is the expected correct behavior?

CI_MERGE_REQUEST_LABELS should be set in all merge request jobs, including stop jobs.

Relevant logs and/or screenshots

n/a

Output of checks

This bug happens on gitlab.com

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 Jul 24, 2025 by 🤖 GitLab Bot 🤖
Assignee Loading
Time tracking Loading