Skip to content

Job's dynamic tags are not replaced by variables set in rules

Summary

When using variables in the tags given to a job, any variable set by a rule is not replaced.

Steps to reproduce

Example pipeline:

deploy:
  stage: deploy
  script:
    - echo "hello"
    - echo "$MY_TAG"
  tags:
    - $MY_TAG
  rules:
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      variables:
        MY_TAG: "tag_from_rule"

Create a merge request and the pipeline will be stuck, and in the UI it will show a tag $MY_TAG

Example Project

taylor.daugherty/dynamic-tags-issue!1

What is the current bug behavior?

The tag is not replaced by the variable set in the rule.

What is the expected correct behavior?

The tag should be replaced by the variable set in the rule.

Relevant logs and/or screenshots

Screen_Shot_2022-12-13_at_6.29.16_PM

Output of checks

This bug happens on GitLab.com

Possible fixes

Edited by 🤖 GitLab Bot 🤖