Skip to content

Commit 8c5180c

Browse files
authored
Explicitly triggering release pipelines (#10057)
* Explicit invocation of target pipeline.
1 parent 637b3f9 commit 8c5180c

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.pipelines/Release-trigger.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,32 @@ trigger:
88

99
pr: none
1010

11+
parameters:
12+
- name: TargetPipelines
13+
type: object
14+
default:
15+
- id: 21120
16+
paramName: NuGetGallerySubmoduleBranch
17+
- id: 21280
18+
paramName: NuGetGalleryBranch
19+
1120
variables:
1221
- name: NugetMultifeedWarnLevel
1322
value: none
14-
23+
1524
pool:
1625
vmImage: 'windows-latest'
1726

1827
steps:
19-
- powershell: Write-Host "Dummy task"
28+
- ${{ each pipeline in parameters.TargetPipelines }}:
29+
- powershell: |-
30+
$body = @{
31+
"templateParameters" = @{
32+
"${{ pipeline.paramName }}" = "$(Build.SourceBranchName)"
33+
}
34+
}
35+
$headers = @{ "Authorization" = "Bearer $env:ACCESS_TOKEN" };
36+
$url = "$(System.CollectionUri)$(System.TeamProject)/_apis/pipelines/${{ pipeline.id }}/runs?api-version=7.0"
37+
Invoke-RestMethod -Uri $url -Method POST -Headers $headers -Body ($body | ConvertTo-Json) -ContentType "application/json"
38+
env:
39+
ACCESS_TOKEN: $(System.AccessToken)

0 commit comments

Comments
 (0)