philthy
philthy

Reputation: 978

Azure pipeline trigger from another repo and branch not working

My aim is to trigger a pipeline in a different repo, from another repo where the branch get's updated. However I can't get it working.

I was trying this:

# Do not trigger for this repo
trigger: none

# Only trigger when "trigger-tests" is updated in other repo
resources:
    - repository: other
      type: git
      name: Project/Repository
      ref: trigger-tests
      trigger:
        branches:
          include:
          - trigger-tests

The other repo is in the same DevOps project.

Upvotes: 1

Views: 3008

Answers (2)

philthy
philthy

Reputation: 978

I've simplified the pipeline even more:

trigger: none

resources:
  repositories:
    - repository: other
      type: git
      name: DevOps/test_repo
      ref: master
      trigger:
        branches:
          include:
          - master

jobs:
- job: One
  steps:
  - script: echo Hello!

It's still not triggering when I update DevOps/test_repo master branch

Upvotes: 0

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31093

You need to make sure the build can run manually first. It seems you missed repositories in your syntax. Check the following sample, which works on my side:

trigger:
- none

resources:
  repositories:
  - repository: other
    type: git
    name: Project/Repository
    ref: master
    trigger:
      branches:
        include:
        - master

In addition, if the issue persists, please create a new pipeline and have another try.

Upvotes: 1

Related Questions