0

I got an Azure yaml pipeline which defines a parameter and is being triggered via a change in 2 different paths in the repo:

trigger:
  branches:
    include: 
     - master
  paths:
    include: 
      - "/SomePath1/*"
      - "/SomePath2/*"
parameters:
  - name: SomeFlag
    default: value1 
    type: string

Is there a way for me to tell the pipeline that if it was triggered from "/SomePath1/" then the parameter gets a value of "value1" and if it was triggered from "/SomePath2/" then it will get the "Value2" (without the need to run the pipeline manually of course) ?

1 Answer 1

1

Not that I'm aware of. You could do some git magic to see which files were changed...

But if you want this, I'd recommend you create 1 template containing most of your pipeline logic and 2 separate yaml files that reference the shared yml and define a specific trigger for the 2 paths. You can also define your path specific variable in there.

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

Comments

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.