You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimize comment noise in maintainer-approval workflow (#4926)
## 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:
- Replaced `postComment` (delete+create) with `upsertComment` (find,
compare, edit-in-place)
- Removed `buildApprovedComment` and `buildAllGroupsApprovedComment`
(commit status is sufficient)
- All three success paths (maintainer approval, maintainer-authored, all
groups approved) now only set commit status and clean up stale marker
comments
- Added `deleteMarkerComments` helper for success-path cleanup
## Test plan
- [x] All 20 unit tests pass (`node --test
.github/workflows/maintainer-approval.test.js`)
- [x] Tests cover: create when none exists, edit in place, skip when
unchanged, duplicate cleanup, stale comment cleanup on approval,
no-comment on all success paths
This pull request was AI-assisted by Isaac.
0 commit comments