Skip to content
GitLab
Next
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    Projects Groups Snippets
  • Sign up now
  • Login
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 46,746
    • Issues 46,746
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,532
    • Merge requests 1,532
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #10126
Closed
Open
Issue created Feb 27, 2019 by Adam Reichold@adam-rhebo

Support variable expansion in branch property of trigger keyword

We want to avoid spawning an actual CI job on CI runner just to execute cURL to trigger downstream pipelines which bridge jobs should allow us to do.

But we maintain several branches in parallel and want to propagate the correct branch into the downstream pipeline, e.g. a master build in the upstream project should trigger a master build in the downstream project whereas a build of release-v1.0 upstream should trigger release-v1.0 downstream.

We naively tried to accomplish this using a bridge job with

trigger:
  project: downstream/project
  branch: $CI_COMMIT_REF_NAME

as we did use --form "ref=$CI_COMMIT_REF_NAME" as a command line argument to curl before. But this does not work as variables are not expanded in the branch parameter and hence the bridge job fails as no ref named $CI_COMMIT_REF_NAME exists in the downstream repository.

Edited Oct 14, 2019 by Jason Yavorska
Assignee
Assign to
Time tracking