Can’t trigger a pipeline hosted in RepoA when a commit is pushed to RepoB
I’m using Version Dev17.M153.5 (TFS), and I have two repositories: my source code is hosted in Repo B, and my pipelines are hosted in Repo A to keep responsibilities separated.
My goal is for the pipeline in Repo A to automatically run whenever a commit is pushed to Repo B. Below is my current setup:
# MY MAIN PIPELINE IN REPO A:
trigger: none
resources:
repositories:
– repository: RepoB
type: git
name: Project/RepoB
ref: develop
trigger:
branches:
include:
– develop
– master
pool:
name: ‘Test’
variables:
REPO_URL: ‘https://tfs.company.com/company/Project/_git/RepoB’
steps:
– task: PowerShell@2
displayName: ‘Configurar encabezado GIT_AUTH_HEADER con PAT’
inputs:
targetType: ‘inline’
script: |
$headerValue = “Authorization: Basic ” + [Convert]::ToBase64String([System.Text.Encoding]::UTF8. GetBytes(“:” + $env:PAT))
git -c http.extraheader=”$headerValue” clone $(REPO_URL)
env:
PAT: $(PAT)
#Templates
– ${{ if eq(variables[‘Build.SourceBranch’], ‘refs/heads/master’) }}:
– template: pipeline-master.yml
– ${{ if eq(variables[‘Build.SourceBranch’], ‘refs/heads/develop’) }}:
– template: pipeline-develop.yml
The Issue:
This pipeline does not trigger automatically when a commit is pushed to Repo B on either develop or master. I cannot use checkout because it only accepts self or none. However, Repo B is successfully cloned, and the pipeline runs fine if I trigger it manually
Additional Considerations:
– Build services have “Read and Contribute” permissions set to “Allow” in both repositories.
– Both Repo A and Repo B are part of the same project in Azure DevOps
– The Personal Access Token (PAT) is correctly configured, and the pipeline passes when executed manually.
– The YAML is hosted in the default branch (master) of Repo B
Question: Why is the pipeline not triggering automatically, and how can I ensure it runs whenever a commit is pushed to Repo B?
Many thanks in advance!
I’m using Version Dev17.M153.5 (TFS), and I have two repositories: my source code is hosted in Repo B, and my pipelines are hosted in Repo A to keep responsibilities separated.My goal is for the pipeline in Repo A to automatically run whenever a commit is pushed to Repo B. Below is my current setup: # MY MAIN PIPELINE IN REPO A:
trigger: none
resources:
repositories:
– repository: RepoB
type: git
name: Project/RepoB
ref: develop
trigger:
branches:
include:
– develop
– master
pool:
name: ‘Test’
variables:
REPO_URL: ‘https://tfs.company.com/company/Project/_git/RepoB’
steps:
– task: PowerShell@2
displayName: ‘Configurar encabezado GIT_AUTH_HEADER con PAT’
inputs:
targetType: ‘inline’
script: |
$headerValue = “Authorization: Basic ” + [Convert]::ToBase64String([System.Text.Encoding]::UTF8. GetBytes(“:” + $env:PAT))
git -c http.extraheader=”$headerValue” clone $(REPO_URL)
env:
PAT: $(PAT)
#Templates
– ${{ if eq(variables[‘Build.SourceBranch’], ‘refs/heads/master’) }}:
– template: pipeline-master.yml
– ${{ if eq(variables[‘Build.SourceBranch’], ‘refs/heads/develop’) }}:
– template: pipeline-develop.yml The Issue:This pipeline does not trigger automatically when a commit is pushed to Repo B on either develop or master. I cannot use checkout because it only accepts self or none. However, Repo B is successfully cloned, and the pipeline runs fine if I trigger it manually Additional Considerations:- Build services have “Read and Contribute” permissions set to “Allow” in both repositories.- Both Repo A and Repo B are part of the same project in Azure DevOps- The Personal Access Token (PAT) is correctly configured, and the pipeline passes when executed manually.- The YAML is hosted in the default branch (master) of Repo B Question: Why is the pipeline not triggering automatically, and how can I ensure it runs whenever a commit is pushed to Repo B? Many thanks in advance! Read More