Skip to content

Fix maintainer-approval not blocking PRs without approval#4935

Merged
simonfaltum merged 2 commits intomainfrom
simonfaltum/fix-maintainer-approval-merge-queue
Apr 13, 2026
Merged

Fix maintainer-approval not blocking PRs without approval#4935
simonfaltum merged 2 commits intomainfrom
simonfaltum/fix-maintainer-approval-merge-queue

Conversation

@simonfaltum
Copy link
Copy Markdown
Member

@simonfaltum simonfaltum commented Apr 13, 2026

Why

PR #4931 switched maintainer-approval from commit statuses (createCommitStatus) to check runs (checks.create) so the check is clickable in the GitHub UI. The pending state used status: "in_progress", which GitHub treats as "still running" rather than "blocking". This meant all PRs could merge without maintainer approval.

Changes

Removes the three checks.create calls for pending states (wildcard files, uncovered groups, no approval). When no check run or status exists for maintainer-approval on a SHA, GitHub shows the required check as "Expected" (yellow dot) and blocks the merge. Approved PRs still get a success check run (green, clickable).

The result:

  • No approval: yellow dot, merge blocked, reviewer info in PR comment
  • Approved: green checkmark, clickable, shows who approved
  • Merge queue: green checkmark, auto-approved (unchanged)

Test plan

  • All 20 tests in maintainer-approval.test.js pass
  • Verify on a subsequent PR (after merge) that maintainer-approval shows yellow "Expected" without approval, then turns green after approval

Note: the workflow uses pull_request_target, so it runs from main. This PR cannot test itself.

The previous change (PR #4931) switched maintainer-approval from
commit statuses to check runs. However, check runs with status
"in_progress" are treated by GitHub as "still running" and don't
block the required status check, so all PRs could merge without
approval.

Fix: for approved PRs, create a success check run (green, clickable).
For pending PRs, create nothing. The required status check stays as
"Expected" in GitHub (yellow dot), which blocks the merge until
approval is granted.

Co-authored-by: Isaac
@simonfaltum simonfaltum force-pushed the simonfaltum/fix-maintainer-approval-merge-queue branch from 1ab7306 to 340bb35 Compare April 13, 2026 09:50
@simonfaltum simonfaltum added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit 7b69412 Apr 13, 2026
26 checks passed
@simonfaltum simonfaltum deleted the simonfaltum/fix-maintainer-approval-merge-queue branch April 13, 2026 10:52
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.

2 participants