-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
area:permissionsbugSomething isn't workingSomething isn't workingp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature requestprovider:1pAnthropic First-Party APIAnthropic First-Party API
Description
Description
The Claude GitHub App is installed on our repository with Read and write permissions for Contents, Pull Requests, and Issues (confirmed via the installation settings page). However, the installation token returned by the OIDC exchange does not have write access to repository contents, causing git push to fail with a 403.
Reproduction
- Install the official Claude GitHub App with Read & Write for code, PRs, and issues
- Configure workflow with
claude_code_oauth_tokenandid-token: write - Trigger Claude on a PR (in our case, created by a different GitHub App bot)
- Claude commits locally, then runs
git push origin HEAD
Error
remote: Write access to repository not granted.
fatal: unable to access 'https://github.com/<org>/<repo>.git/': The requested URL returned error: 403
Diagnostics
We had Claude run diagnostic commands during a workflow run:
- OIDC exchange succeeds: Logs show
App token successfully obtained - Git remote URL is correctly rewritten:
https://x-access-token:REDACTED@github.com/... - Token lacks write permissions:
// gh api /installation/repositories --jq '.repositories[0].permissions' {"admin": false, "maintain": false, "pull": false, "push": false, "triage": false}
- Push dry-run confirms the 403
- App installation page confirms: Read and write access to code, discussions, issues, pull requests, and workflows
- Claude CAN comment on issues and PRs, so the token has some write permissions — just not contents
Configuration
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read
steps:
- uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
additional_permissions: |
actions: readThe additional_permissions input means the exchange request should include {contents: "write", pull_requests: "write", issues: "write", actions: "read"} per the source in token.ts.
Workaround
Passing an explicit github_token input (from a separate GitHub App via actions/create-github-app-token) bypasses the OIDC exchange and works.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area:permissionsbugSomething isn't workingSomething isn't workingp2Non-showstopper bug or popular feature requestNon-showstopper bug or popular feature requestprovider:1pAnthropic First-Party APIAnthropic First-Party API