ci: exempt private org members from the contribution gate#5848
Merged
Conversation
The contribution gate identified internal maintainers solely from the PR's `author_association`, which GitHub only reports as `MEMBER` when a user's organization membership is public. A private org member (e.g. a `supabase/cli` team member who keeps membership private) is reported as `CONTRIBUTOR`/`NONE`, so the gate wrongly closed their PRs as "no-linked-issue" (see #5847). Resolve maintainer status from the author's effective repository permission (`admin`/`write`), which reflects team/org-granted access that `author_association` does not surface, falling back to it only when the cheap signals (bot, public internal association) are inconclusive. The permission endpoint needs just `Metadata: read`, already covered by the workflow's `contents: read`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D41gYiFBSU7adE4ppnUUKg
Contributor
Supabase CLI previewnpx --yes https://pkg.pr.new/supabase/cli/supabase@05177ef3f74813240c3f963eda4d5daacee86412Preview package for commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5ccaa314a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The collaborator-permission endpoint returns 404 for users who are not collaborators — the common case for the external fork contributors the gate targets. `githubFetch` threw on any non-OK status, so the `pull_request_target` job aborted before evaluating linked issues or closing, leaving non-conforming external PRs open and failing the run. Let `githubFetch` accept a set of allowed non-OK statuses and map a 404 from the permission lookup to `undefined` (external). Other failures still throw, so a transient API error aborts the run without wrongly closing PRs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D41gYiFBSU7adE4ppnUUKg
Coly010
approved these changes
Jul 9, 2026
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 contribution gate identified internal maintainers solely from the PR's
author_association, which GitHub only reports asMEMBERwhen a user's organization membership is public. A private org member (e.g. asupabase/cliteam member who keeps membership private) is reported asCONTRIBUTOR/NONE, so the gate wrongly closed their PRs as "no-linked-issue" (see #5847).Resolve maintainer status from the author's effective repository permission (
admin/write), which reflects team/org-granted access thatauthor_associationdoes not surface, falling back to it only when the cheap signals (bot, public internal association) are inconclusive. The permission endpoint needs justMetadata: read, already covered by the workflow'scontents: read.Claude-Session: https://claude.ai/code/session_01D41gYiFBSU7adE4ppnUUKg