Conversation
…I error Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
pelikhan
March 15, 2026 19:30
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes bot allowlist authorization so it still runs when the repository permission API check fails (e.g., actor is a GitHub App that triggers a 404), preventing allowlisted bots from being incorrectly denied.
Changes:
- Adjusts
check_membership.cjscontrol flow to evaluate the bot allowlist fallback even whencheckRepositoryPermission()returns an error. - Adds three test cases for permission-check error scenarios combined with bot allowlist behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| actions/setup/js/check_membership.cjs | Removes the early return on permission API error so allowlisted bots can still be authorized via bot-status fallback. |
| actions/setup/js/check_membership.test.cjs | Adds test coverage for permission API error paths involving allowlisted and non-allowlisted bots. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| // User doesn't have required permissions, check if they're an allowed bot | ||
| // User doesn't have required permissions (or the permission check failed with an error). | ||
| // Always attempt the bot allowlist fallback before giving up, so that GitHub Apps whose | ||
| // actor is not a recognised GitHub user (e.g. "Copilot") are not silently denied. |
Comment on lines
+60
to
64
| // User doesn't have required permissions (or the permission check failed with an error). | ||
| // Always attempt the bot allowlist fallback before giving up, so that GitHub Apps whose | ||
| // actor is not a recognised GitHub user (e.g. "Copilot") are not silently denied. | ||
| if (allowedBots && allowedBots.length > 0) { | ||
| core.info(`Checking if actor '${actor}' is in allowed bots list: ${allowedBots.join(", ")}`); |
Contributor
|
@copilot review comments |
…n bot_not_active path Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Addressed both review comments in 87fc507:
|
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.
When
checkRepositoryPermission()returns{authorized: false, error: "..."}— e.g. when the actor is a GitHub App (Copilot) that isn't a valid GitHub user and causes a 404 — the code bailed out immediately, never reaching theGH_AW_ALLOWED_BOTSfallback. Bots explicitly listed underbots:in workflow frontmatter were silently denied.Changes
check_membership.cjs: Remove the early-return onresult.error. Merge the error and insufficient-permissions cases into a unifiedelseblock so the bot allowlist is always evaluated first:check_membership.test.cjs: Three new test cases covering the previously unreachable paths: permission API error + bot in allowlist (active), permission API error + bot in allowlist (not installed), and permission API error + actor not in allowlist.