Search code examples
yamlgitlab-ci

Gitlab CI Pass Variable to Included Workflow


I have a worklow which uses a workflow from another project

include: 
  - project: {project repo}
    ref: {branch name}
    file: parent.gitlab-ci.yml

Is there a way to pass a variable to that, similar to how you would pass values to a Github Action? For Example...

include: 
  - project: {project repo}
    ref: {branch name}
    file: parent.gitlab-ci.yml
    Var1: Foo
    Var2: Bar

Thanks,


Solution

  • When a workflow is included, variables are essentially shared with the included workflow. See more here.