Forum Discussion
Can't trigger a pipeline hosted in RepoA when a commit is pushed to RepoB
Try this, please make sure you are fully understanding before apply:
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