-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Enable close-stale-contributor-prs.yml workflow #6615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
codex/.github/workflows/close-stale-contributor-prs.yml
Lines 51 to 70 in 2daf821
| let permission; | |
| try { | |
| const permissionResponse = await github.rest.repos.getCollaboratorPermissionLevel({ | |
| owner, | |
| repo, | |
| username: pr.user.login, | |
| }); | |
| permission = permissionResponse.data.permission; | |
| } catch (error) { | |
| if (error.status === 404) { | |
| core.info(`Author ${pr.user.login} is not a collaborator; skipping #${pr.number}`); | |
| continue; | |
| } | |
| throw error; | |
| } | |
| const hasContributorAccess = ["admin", "maintain", "write"].includes(permission); | |
| if (!hasContributorAccess) { | |
| core.info(`Author ${pr.user.login} has ${permission} access; skipping #${pr.number}`); | |
| continue; |
Now that dryRun is false, the workflow will actually close the PRs selected by the filter below, but the filter only ever matches collaborators with admin/maintain/write access. Non-collaborator contributors hit the 404 in getCollaboratorPermissionLevel and are skipped, so the job never touches the very “contributor PRs” it is supposed to prune and instead auto-closes internal maintainer PRs after 14 idle days. That behavior was harmless while dry-run was true but becomes disruptive once the workflow runs for real.
ℹ️ 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".
Tested on #3036