Skip to content

Commit 8bcad01

Browse files
fix trigger condition
1 parent b0ea65e commit 8bcad01

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.pipelines/azure_pipeline_mergedbranches.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,14 +896,19 @@ extends:
896896
dependsOn:
897897
- Build_And_Publish_Images
898898
# Deploy runs when Build succeeds OR when Build is skipped with valid overrides
899-
# TODO: remove eq(variables['Build.SourceBranch'], 'refs/heads/zane/ci-agent-auto-deploy'),
900-
# this stage runs when Build_And_Publish_Images succeeds or is skipped with valid overrides.
899+
# This stage runs when:
900+
# 1. Direct push to ci_prod or zane/ci-agent-auto-deploy or branches containing 'run-e2e'
901+
# 2. PR from zane/ci-agent-auto-deploy branch
901902
condition: |
902903
and(
903904
or(
904905
eq(variables['Build.SourceBranch'], 'refs/heads/ci_prod'),
905906
eq(variables['Build.SourceBranch'], 'refs/heads/zane/ci-agent-auto-deploy'),
906-
contains(variables['Build.SourceBranch'], 'run-e2e')
907+
contains(variables['Build.SourceBranch'], 'run-e2e'),
908+
and(
909+
eq(variables['Build.Reason'], 'PullRequest'),
910+
eq(variables['System.PullRequest.SourceBranch'], 'refs/heads/zane/ci-agent-auto-deploy')
911+
)
907912
),
908913
or(
909914
eq(dependencies.Build_And_Publish_Images.result, 'Succeeded'),

0 commit comments

Comments
 (0)