Skip to content

configureGitAuth function incompatible with actions/checkout@v4.3.1,v5.0.1,v6 #907

@StuporHero

Description

@StuporHero

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

  1. Install the official Claude GitHub App with Read & Write for code, PRs, and issues
  2. Configure workflow with claude_code_oauth_token and id-token: write
  3. Trigger Claude on a PR (in our case, created by a different GitHub App bot)
  4. 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: read

The 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:permissionsbugSomething isn't workingp2Non-showstopper bug or popular feature requestprovider:1pAnthropic First-Party API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions