Skip to content

Cannot manually specify CI/CD variables before running a manual trigger job

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

Given that

  • when a pipeline features a manual job, clicking on the job leads to a page where you can pass custom variables to the job

e.g.:

image

leads to:

image

Then I expect that

  • when a pipeline features a manual trigger-job, clicking on the job should lead to a page where you can pass custom variables to the child pipe and all the jobs it contains.

Found

  • the manual trigger job is not a link.

image

It can only be played "as-is".

image

If I need to pass any custom directives to that pipe, I have to run a job before it that will create an artifact or a cache that will be visible to the child pipe to find the message inside, and unfortunately, we have such jobs who's all purpose is to precede a child pipe do just that.

about us

we're on a self-hosted 15.4-ee from linux package, k8s runners 15.4-ee, recommended architecture, ultimate plan.

Documentation:

Documentation states:

You cannot manually specify CI/CD variables before running a manual trigger job.

Workaround:

Define the variables in the parent pipeline via pre-filled variables using trigger:forward with pipeline_variables:true :

Parent YAML:

variables:
  VAR1:
      value: "Variable from Parent in YAML"
      description: "This is a variable"

trigger_job:
    trigger:
        include:
        - local: /child-pipeline.yml
        forward:
          pipeline_variables: true
    when:
        manual

Child YAML:

test:
    script: 
        - echo "Test Job - Child pipeline"
        - echo $VAR1

Screenshot_2023-09-22_at_13.56.12

Screenshot_2023-09-22_at_13.57.36

Edited by 🤖 GitLab Bot 🤖