Skip to content

fix(github-actions): enforce approval SHA freshness and harden post-approval review requests - #4024

Merged
alan-agius4 merged 4 commits into
angular:mainfrom
josephperrott:fix/review-gate-sha-freshness
Oct 12, 2026
Merged

alan-agius4 merged 4 commits into
angular:mainfrom
josephperrott:fix/review-gate-sha-freshness

Conversation

@josephperrott

@josephperrott josephperrott commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Enforce commit SHA freshness on pull request approvals in post-approval-changes (including on reopened events), ignore trailing COMMENTED reviews when deduplicating reviewer states, re-request all stale Googler approvers on new commits, and fail closed if the googlers org installation token cannot be obtained.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the post-approval changes GitHub Action by extracting its core logic into a separate module, adding comprehensive unit tests, and enhancing its behavior to handle reopened events, ignore comment-only reviews, and re-request reviews from all stale approvers. Additionally, it updates the pull request validation to ensure that at least one team member's review is on the latest commit. The review feedback suggests wrapping individual token revocations in separate try-catch blocks within the finally block to prevent token leaks if one revocation fails, and adding defensive null checks for the review object during validation to avoid potential runtime crashes.

Comment thread github-actions/post-approval-changes/lib/post-approval-changes.ts
Comment thread ng-dev/pr/common/validation/assert-minimum-reviews.ts
@josephperrott
josephperrott force-pushed the fix/review-gate-sha-freshness branch 2 times, most recently from 8637afd to 0b46e3a Compare October 9, 2026 19:14
Comment thread ng-dev/pr/common/validation/assert-minimum-reviews.ts Outdated
@josephperrott
josephperrott force-pushed the fix/review-gate-sha-freshness branch from 0b46e3a to 3f0a7ee Compare October 12, 2026 09:14
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Oct 12, 2026
@alan-agius4
alan-agius4 merged commit 5bb5325 into angular:main Oct 12, 2026
17 checks passed
@alan-agius4

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

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

Labels

action: merge The PR is ready for merge by the caretaker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants