You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
checkWritePermissions() in src/github/validation/permissions.ts calls octokit.repos.getCollaboratorPermissionLevel() with github.actor as the username. When the actor is Copilot (from a Copilot-initiated pull_request_review), this API call returns 404 because Copilot is not a regular GitHub user.
The function has a bypass for actors ending in [bot] (line 47), but Copilot doesn't match that pattern.
To Reproduce
Configure anthropics/claude-code-action@v1 on a pull_request_review workflow
Have GitHub Copilot submit a review, triggering the workflow with github.actor = "Copilot"
The checkWritePermissions call fails with 404
Error Log
Using provided GITHUB_TOKEN for authentication
Checking permissions for actor: Copilot
GET /repos/goodtune/ghp/collaborators/Copilot/permission - 404 with id AC45:74D71:1143342:4A95233:69A9F64B in 157ms
##[error]Failed to check permissions: HttpError: Copilot is not a user - https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user
##[error]Action failed with error: Failed to check permissions for Copilot: HttpError: Copilot is not a user - https://docs.github.com/rest/collaborators/collaborators#get-repository-permissions-for-a-user
In src/github/validation/permissions.ts, the bot bypass only checks for [bot] suffix:
// Line 47-50if(actor.endsWith("[bot]")){core.info(`Actor is a GitHub App: ${actor}`);returntrue;}
Copilot is a non-user actor that doesn't follow the [bot] naming convention, so it falls through to the API call which 404s.
Suggested Fix
Catch 404 errors from the collaborator permission API and check whether the actor is a known non-user entity, or fall back to checking triggering_actor permissions instead.
A simpler approach: wrap the API call in error handling that recognises "not a user" 404s and consults allowed_bots before throwing.
Describe the bug
checkWritePermissions()insrc/github/validation/permissions.tscallsoctokit.repos.getCollaboratorPermissionLevel()withgithub.actoras the username. When the actor isCopilot(from a Copilot-initiatedpull_request_review), this API call returns 404 becauseCopilotis not a regular GitHub user.The function has a bypass for actors ending in
[bot](line 47), butCopilotdoesn't match that pattern.To Reproduce
anthropics/claude-code-action@v1on apull_request_reviewworkflowgithub_tokeninput (to bypass OIDC exchange — see OIDC token exchange fails with 401 whengithub.actorisCopilot#1017)github.actor = "Copilot"checkWritePermissionscall fails with 404Error Log
Root Cause
In
src/github/validation/permissions.ts, the bot bypass only checks for[bot]suffix:Copilotis a non-user actor that doesn't follow the[bot]naming convention, so it falls through to the API call which 404s.Suggested Fix
Catch 404 errors from the collaborator permission API and check whether the actor is a known non-user entity, or fall back to checking
triggering_actorpermissions instead.A simpler approach: wrap the API call in error handling that recognises "not a user" 404s and consults
allowed_botsbefore throwing.Related Issues
github.actorisCopilot#1017 — Server-side OIDC token exchange also fails for Copilot actor (precedes this check)checkHumanActorcheckHumanActorfor bot actors in scheduled workflowsAPI Provider