Minimize comment noise in maintainer-approval workflow#4926
Merged
simonfaltum merged 2 commits intomainfrom Apr 10, 2026
Merged
Minimize comment noise in maintainer-approval workflow#4926simonfaltum merged 2 commits intomainfrom
simonfaltum merged 2 commits intomainfrom
Conversation
Previously the workflow deleted and recreated the PR comment on every push, review, and reopen. This caused notification noise for all participants. Now the workflow edits the existing comment in place (which does not trigger notifications), skips the edit entirely when the body has not changed, and stops posting approval comments since the commit status already conveys that information. Co-authored-by: Isaac
Address review feedback: when a PR transitions from pending to approved, delete any leftover marker comments so the PR does not show a stale "Waiting for approval" comment alongside a green commit status. Co-authored-by: Isaac
mihaimitrea-db
approved these changes
Apr 10, 2026
Approved (maintainer-authored PR)See OWNERS for ownership rules. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The maintainer-approval GitHub Action deletes and recreates its PR comment on every push, review change, and reopen event. Each delete+create cycle sends notifications to all participants, creating unnecessary noise. Approval state comments ("Approved by @user") are also redundant since the commit status already conveys that information.
Changes
Before: every workflow run deletes the old comment and posts a new one, even if nothing changed. Approval events post dedicated "Approved by" comments.
Now: the workflow edits the existing comment in place (no notification), skips the edit entirely when the body hasn't changed, and stops posting approval comments. On approval, any stale pending comment is cleaned up so the PR doesn't show a misleading "Waiting for approval" alongside a green status.
Specifically:
postComment(delete+create) withupsertComment(find, compare, edit-in-place)buildApprovedCommentandbuildAllGroupsApprovedComment(commit status is sufficient)deleteMarkerCommentshelper for success-path cleanupTest plan
node --test .github/workflows/maintainer-approval.test.js)This pull request was AI-assisted by Isaac.