0

Say I have two pipelines: PL1 and PL2 and that PL2 is triggered by PL1. Say I ran PL1 on the master branch, I want PL2 to also get triggered for the master branch. When PL1 is triggered on another branch, like releases/X.X.X I want PL2 to also be triggered on the releases/X.X.X branch. Can I do that? Right now PL2 is always using master when it gets triggered

1 Answer 1

2

I tried to replicate the scenario.

First pipeline:

trigger:
  - none

stages:
  - stage: first
    jobs: 
     - job: firstJob
       continueOnError: false
       steps:
         - bash: echo "first from test branch"

Second Pipeline:

resources:
  pipelines:
  - pipeline: firstPipeline
    source: first-pipeline
    trigger:
     branches:
      include:
        - ${Build.SourceBranch}

stages:
  - stage: second
    jobs: 
     - job: secondJob
       steps: 
         - bash: echo Test-branch

I tested these from two different branches and each time the source code of second pipeline was picked up based on the first pipeline's branch.

PS: Both of my pipeline YAML are in same repository

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, I had something similar but it wasnt working, this helped though!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.