azure devops pipeline resource trigger

triggered pipeline

trigger: none
# trigger: 
#   branches:
#     exclude:
#       - master
 
pool:
  name: testpool

resources:
  pipelines:
   - pipeline: testtest
     source: triggeringpipeline
     trigger: true
      #  stages:
      #  - dev

########################################## DEV ##########################################
steps:
- task: PowerShell@2
  inputs:
    targetType: 'inline'
    script: |
      # Write your PowerShell commands here.
      Write-Host "$(resources.pipeline.testtest.runName)"
      Write-Host "Hello World"

triggering pipeline

# no trigger on master
# pipeline name: triggeringpipeline
trigger: none
  # branches:
  #   exclude:
  #     - master
pool:
  name: testpool
steps:
- bash: echo "The security-lib-ci pipeline runs first"
- script: |
    echo Add other tasks to build, test, and deploy your project.
    echo See https://aka.ms/yaml
  displayName: 'Run a multi-line script'

I set up two pipelines so that one pipeline would trigger when other pipeline finishes running but it doesn't seem to work but i confirmed that they are linked. what am i missing here?

enter image description here

Upvotes: 0

Views: 1148

Answers (1)

Kevin Lu-MSFT
Kevin Lu-MSFT

Reputation: 35514

From your YAML sample, you have set the pipeline trigger but it doesn't work.

You need to check the branch where the triggered pipeline yaml is located.

Then you can modify the Default branch for manual and scheduled builds in YAML pipeline.

Refer to the steps:

In Yaml, triggered pipeline yaml is in test branch.

Then navigate to Triggers -> YAML -> Default branch for manual and scheduled builds and change the branch.

enter image description here

enter image description here

Upvotes: 1

Related Questions