Repository navigation
Allow Copilot coding agents through the bot allowlist without collaborator lookup #67238
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
Changes from 2 commits
70cdf3b
f7d2328
6591aad
fb33cbd
7118ce0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,11 +32,13 @@ async function checkBotAllowlistAuthorization(actorToValidate, allowedBots, owne | |
|
|
||
| core.info(`Actor '${actorToValidate}' matched the allowed bots list: ${allowedBots.join(", ")}`); | ||
|
|
||
| // Verify the bot is active/installed on the repository | ||
| const botStatus = await checkBotStatus(actorToValidate, owner, repo); | ||
| // Built-in Copilot agents are not repository collaborators; the explicit allowlist | ||
| // is sufficient for their GitHub-provided actor identities. | ||
| const isBuiltInCopilot = actorToValidate === "Copilot" || actorToValidate === "copilot-swe-agent" || actorToValidate === "copilot-swe-agent[bot]"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/diagnosing-bugs] This hardcodes a third, independent list of "built-in Copilot" identities ( 💡 Why this mattersThe root cause of #67157 is "GitHub App/bot identities aren't repository collaborators, so the lookup 404s." That's exactly what
Consider either: (a) extracting a shared @copilot please address this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/codebase-design] The three-way literal string comparison ( 💡 Suggested simplificationconst canonicalActor = canonicalizeBotIdentifier(actorToValidate);
const isBuiltInCopilot = canonicalActor === "Copilot" || canonicalActor === "copilot-swe-agent";This reduces three branches to two, matches the existing canonicalization convention used by @copilot please address this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This literal identity list ( Consider deriving this list from a shared JS constant (mirroring @copilot please address this.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in |
||
| const botStatus = isBuiltInCopilot ? { isBot: true, isActive: true } : await checkBotStatus(actorToValidate, owner, repo); | ||
|
|
||
| if (botStatus.isBot && botStatus.isActive) { | ||
| core.info(`✅ Bot '${actorToValidate}' is active on the repository and authorized`); | ||
| core.info(isBuiltInCopilot ? `✅ Built-in bot '${actorToValidate}' is allowlisted and authorized` : `✅ Bot '${actorToValidate}' is active on the repository and authorized`); | ||
| core.setOutput("is_team_member", "true"); | ||
| core.setOutput("result", "authorized_bot"); | ||
| core.setOutput("user_permission", "bot"); | ||
|
|
||
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.
This bypass only recognizes three hard-coded actor strings, so supported Copilot aliases like
copilotand@app/copilot-swe-agentstill fall through tocheckBotStatus()and get rejected asbot_not_active.💡 Why this blocks the fix
The compiler already expands
on.bots: [copilot]to the full Copilot family (copilot-swe-agent,Copilot,copilot,@app/copilot-swe-agent). With the current check, onlyCopilot,copilot-swe-agent, andcopilot-swe-agent[bot]bypass the collaborator lookup, so two canonical identities that the product explicitly emits remain broken.Please derive this exception from the same normalized Copilot alias set the compiler uses, or at least include every expanded identifier after stripping an optional
[bot]suffix, so the auth path cannot drift again.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.
Fixed in
fb33cbd: the membership check now recognizes every compiler-supplied Copilot alias after[bot]normalization and only allows a conclusive collaborator 404. Regression coverage exercises the full alias family.