Skip to content

Commit b047a7c

Browse files
Attempt to trigger Azure pipelines on merge queue events (#9809)
* Attempt to trigger Azure pipelines on merge queue events This commit attempts to add a trigger condition to our azure pipelines job to trigger on commits to the gh merge queue branch. * Only trigger PR CI in queue, not push CI --------- Co-authored-by: Jake Lishman <[email protected]>
1 parent b4bc559 commit b047a7c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

azure-pipelines.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ trigger:
88
include:
99
- 'main'
1010
- 'stable/*'
11+
- 'gh-readonly-queue/*'
1112
tags:
1213
include:
1314
- '*'
@@ -126,8 +127,10 @@ stages:
126127
id: 7864
127128
comment: Nightly test job failed at commit $(Build.SourceVersion). View the logs at $(System.TeamFoundationCollectionUri)$(System.TeamProject)/_build/results?buildId=$(Build.BuildId).
128129

129-
# Full PR suite.
130-
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
130+
# Full PR suite. This also needs to apply to the merge queue, which appears
131+
# as a push event. The queue won't get cron triggered because the schedule
132+
# trigger doesn't have it as a target.
133+
- ${{ if or(eq(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.SourceBranch'], 'gh-readonly-queue')) }}:
131134
# The preliminary stage should be small in both total runtime (including
132135
# provisioning) and resources required. About half of PR commits result in
133136
# a CI failure, and over 90% of these are in linting, documention or a test
@@ -188,9 +191,9 @@ stages:
188191
parameters:
189192
pythonVersion: ${{ parameters.maximumPythonVersion }}
190193

191-
# Push to main or the stable branches. The triggering branches are set in the
192-
# triggers at the top of this file.
193-
- ${{ if and(eq(variables['Build.Reason'], 'IndividualCI'), startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}:
194+
# Push to main or the stable branches. The triggering branches also need to
195+
# be in the triggers at the top of this file.
196+
- ${{ if and(eq(variables['Build.Reason'], 'IndividualCI'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/stable/'))) }}:
194197
- stage: "Push"
195198
jobs:
196199
- template: ".azure/test-linux.yml"

0 commit comments

Comments
 (0)