Repository navigation
Bypass the approved-issue check for all repository collaborators - #17
laxmareddyp wants to merge 1 commit into
Conversation
| try { | ||
| await github.rest.repos.checkCollaborator({ owner, repo, username }); |
There was a problem hiding this comment.
I don't understand what's going on with { owner, repo, username } here.
Shouldn't it be something like { "owner": owner, "repo": repo, "username": username} ?
There was a problem hiding this comment.
That is ES2015 shorthand property syntax, { owner, repo, username } is identical to { owner: owner, repo: repo, username: username }. It is the same form this file already uses for issues.get({ owner, repo, issue_number: number }) a bit above, and the test mock destructures username from it, so the key is set.
|
Once this is merged I will open a PR in keras-hub bumping the |
GitHub event payloads only report
author_association: "MEMBER"when a user's organization membership is public. Privatekeras-teammembers whose access comes through the organization or a team (rather than a direct repository collaborator entry) are reported asCONTRIBUTORin thepull_request_targetpayload and get caught by the approved-issue check.This adds a collaborator check via
github.rest.repos.checkCollaboratorinsidescripts/pr-approved-issue.js. The endpoint returns204for every organization member, team member, and direct collaborator regardless of role (admin, maintain, write, triage, or org-default read) or membership visibility, and404for external contributors. Lookup errors log a warning and fail closed so external PRs are still checked.