feat(agent-approval-check): re-evaluate on native reviews - #55
Merged
Conversation
Trigger on pull_request_review so a native Approve is counted immediately, instead of only on the next push or /approve comment. This action never checks out or runs pull-request code (it reads the API and posts a status from pinned action code), so the merge-ref concern that leads some workflows to omit pull_request_review does not apply here.
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.
Summary
Adds
pull_request_reviewto the action's supported events so a native GitHub Approve is counted immediately, instead of only being picked up on the nextsynchronize/push or/approve <sha>comment.Why
The upstream design omits
pull_request_reviewout of a merge-ref concern (not running a privileged, secret-bearing workflow from PR-influenced state). That concern is about workflows that check out and execute pull-request code. This action never does that — it only reads the GitHub API and posts a commit status, running its own SHA-pinned action code from the base-branch workflow. Sopull_request_reviewis safe here, and using it removes the confusing UX where reviewers Approve natively but the required check appears stuck until someone comments.Changes
resolve_pr_numberhandlespull_request_review(PR number fromevent.pull_request.number)pull_request_review: [submitted, dismissed]trigger to the example, and correct the approval-behavior/known-limitations notesConsumer change
Workflows should add the
pull_request_reviewtrigger (see README).Testing
python3 -m unittest discover -s actions/agent-approval-check -p 'test_*.py' -v(23 passing)