Skip to content

Commit f312e63

Browse files
authored
don't deploy preview if auto-merge enabled (github#27949)
1 parent 7f42c91 commit f312e63

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/azure-preview-env-deploy.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,16 @@ jobs:
198198
# Deploy ARM template is idempotent
199199
# Note: once the resources exist the image tag must change for a new deployment to occur (the image tag includes workflow run number, run attempt, as well as sha)
200200
- name: Run ARM deploy
201-
id: deploy
201+
# This 'if' will be truth, if this workflow is...
202+
# - run as a workflow_dispatch
203+
# - run because of a push to main (or gh-readonly-queue/main)
204+
# - run as a regular pull request
205+
# But if it's a pull request, *and* for whatever reason, the pull
206+
# request has "Auto-merge" enabled, don't bother.
207+
# The idea is that if auto-merge has been abled, by humans or by
208+
# bots, they have no intention of viewing the deployed preview anyway.
209+
# This saves time because the PR can merge sooner.
210+
if: ${{ !github.event.pull_request.auto_merge }}
202211
uses: azure/arm-deploy@841b12551939c88af8f6df767c24c38a5620fd0d
203212
with:
204213
resourceGroupName: ${{ secrets.PREVIEW_ENV_RESOURCE_GROUP }}

0 commit comments

Comments
 (0)