chore: require hub-team approval via Actions check#7
Closed
andresbayon wants to merge 1 commit into
Closed
Conversation
Adds a 'require-hub-approval' workflow that passes only when the latest review from a member of the hub team is an approval. Replaces the CODEOWNERS team-review requirement without committing the team name to the source tree: the team slug lives in the HUB_TEAM_SLUG Actions variable and the org is derived from github.repository_owner. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The changes I made
Adds a
require-hub-approvalGitHub Actions workflow that gates merges on an approval from a hub-team member — the protection CODEOWNERS used to provide — without committing the team name to the source tree.How it stays clean of internal references:
HUB_TEAM_SLUG(set tohub), not in the workflow file.github.repository_owner.How the check works:
pull_request(opened/reopened/synchronize) andpull_request_review(submitted/dismissed/edited).CHANGES_REQUESTED/DISMISSEDoverrides an earlierAPPROVED;COMMENTEDis ignored).@<org>/${{ vars.HUB_TEAM_SLUG }}.Prerequisites before this becomes effective
HUB_APPROVAL_TOKEN— a token withread:org+ pull-request read (the defaultGITHUB_TOKENcan't read org team membership). A classic PAT withrepo, read:orgscopes (ideally from a bot/service account) works.require-hub-approvaltomain's required status checks.How To Test/Validate
HUB_APPROVAL_TOKENsecret.🤖 Generated with Claude Code