Skip to content

Commit 095b566

Browse files
mattleibowCopilot
andauthored
Only trigger on OpenPublishing.Build, not both statuses (#85)
Triggering on both OpenPublishing.Build and PoliCheck Scan causes duplicate comments — both fire at roughly the same time and both find all required statuses green. Fix: trigger only on OpenPublishing.Build (which carries the build report URL we need). PoliCheck is still verified as a required status inside the script — it just doesn't trigger a separate run. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7b2d953 commit 095b566

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/automerge-docs.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,20 @@ permissions:
1414

1515
jobs:
1616
check-and-merge:
17-
# Only run when a Learn Build status succeeds on the automation branch.
18-
# Ignore pending/error/failure — we only care when a status completes green.
17+
# Trigger when either Learn Build status succeeds on the automation branch.
18+
# The script requires BOTH to be present before proceeding.
1919
if: |
2020
github.event.state == 'success' &&
2121
(github.event.context == 'OpenPublishing.Build' ||
2222
github.event.context == 'PoliCheck Scan') &&
2323
contains(github.event.branches.*.name, 'automation/write-api-docs')
24+
25+
# Only one run at a time per commit SHA. If both statuses succeed
26+
# simultaneously, the second run waits then gets cancelled since
27+
# the first already handled it (PR merged or comment posted).
28+
concurrency:
29+
group: automerge-${{ github.event.sha }}
30+
cancel-in-progress: false
2431
runs-on: ubuntu-latest
2532

2633
steps:

0 commit comments

Comments
 (0)