Skip to content

Fix automerge: prevent duplicate comments and handle status ordering#85

Merged
mattleibow merged 1 commit into
mainfrom
fix-duplicate-automerge-comments
May 11, 2026
Merged

Fix automerge: prevent duplicate comments and handle status ordering#85
mattleibow merged 1 commit into
mainfrom
fix-duplicate-automerge-comments

Conversation

@mattleibow

@mattleibow mattleibow commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes duplicate dry-run/merge comments and handles any arrival order of statuses.

Problems:

  1. Triggering on both OpenPublishing.Build and PoliCheck Scan caused 2 identical comments when both succeeded at roughly the same time
  2. Triggering on only one status would miss the case where the other arrives last

Fix:

  • Trigger on both statuses (handles any ordering)
  • Add concurrency: automerge-\${{ github.event.sha }} to serialize runs per commit — if both fire simultaneously, the second waits then sees the first already handled it
  • Script still requires both statuses present before proceeding; exits silently if one is missing

Result: exactly 1 comment per commit regardless of which status arrives first.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit 1ae16f5:

✅ Validation status: passed

File Status Preview URL Details
.github/workflows/automerge-docs.yml ✅Succeeded

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

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>
@mattleibow
mattleibow force-pushed the fix-duplicate-automerge-comments branch from 1ae16f5 to cd10ed7 Compare May 11, 2026 18:46
@mattleibow mattleibow changed the title Fix automerge: only trigger on OpenPublishing.Build Fix automerge: prevent duplicate comments and handle status ordering May 11, 2026
@mattleibow
mattleibow merged commit 095b566 into main May 11, 2026
1 of 3 checks passed
@mattleibow
mattleibow deleted the fix-duplicate-automerge-comments branch May 11, 2026 18:48
@learn-build-service-prod

Copy link
Copy Markdown
Contributor

Learn Build status updates of commit cd10ed7:

✅ Validation status: passed

File Status Preview URL Details
.github/workflows/automerge-docs.yml ✅Succeeded

For more details, please refer to the build report.

@learn-build-service-prod

Copy link
Copy Markdown
Contributor

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 and severity-2 issues. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant