diff --git a/.github/workflows/daily_ai_fix.yaml b/.github/workflows/daily_ai_fix.yaml index 8423d2ea84..337405c9f4 100644 --- a/.github/workflows/daily_ai_fix.yaml +++ b/.github/workflows/daily_ai_fix.yaml @@ -50,7 +50,6 @@ permissions: contents: write issues: write pull-requests: write - id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow concurrency: group: ai-fix-sweep @@ -129,6 +128,11 @@ jobs: uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + # Skip the OIDC -> Claude App token exchange. The scheduled path + # happens to pass it (github.actor is the maintainer), but + # workflow_dispatch by anyone else would 401. AI_PR_TOKEN, not + # GITHUB_TOKEN, so a PR Claude opens triggers CI. + github_token: ${{ secrets.AI_PR_TOKEN }} # One sticky, auto-updating status comment per run instead of the # model narrating its own progress in scattered comments. track_progress: true diff --git a/.github/workflows/on_issue_approved.yaml b/.github/workflows/on_issue_approved.yaml index 6afb92a35c..1b363697e4 100644 --- a/.github/workflows/on_issue_approved.yaml +++ b/.github/workflows/on_issue_approved.yaml @@ -32,7 +32,6 @@ permissions: contents: write issues: write pull-requests: write - id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow concurrency: group: ai-approve-${{ github.event.issue.number || inputs.issue }} @@ -139,6 +138,10 @@ jobs: uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + # Skip the OIDC -> Claude App token exchange, which 401s whenever + # github.actor lacks write access. AI_PR_TOKEN, not GITHUB_TOKEN, so + # a PR Claude opens triggers CI. + github_token: ${{ secrets.AI_PR_TOKEN }} track_progress: true prompt: | The approved plan is /tmp/ai-exec/plan.md and the issue it belongs diff --git a/.github/workflows/on_issues_ai_triage.yaml b/.github/workflows/on_issues_ai_triage.yaml index 5237ba9294..c27c1cd392 100644 --- a/.github/workflows/on_issues_ai_triage.yaml +++ b/.github/workflows/on_issues_ai_triage.yaml @@ -41,7 +41,6 @@ on: permissions: contents: read issues: write - id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow concurrency: group: ai-triage-${{ github.event.issue.number || inputs.issue || github.run_id }} @@ -148,6 +147,12 @@ jobs: uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + # Without this the action falls back to the OIDC -> Claude App token + # exchange, which 401s ("User does not have write access on this + # repository") whenever github.actor is the outside reporter who + # opened the issue or replied to a needs-info request. Same token the + # step already exports as GH_TOKEN; classify only reads. + github_token: ${{ secrets.GITHUB_TOKEN }} show_full_output: true prompt: | Read /tmp/ai-triage/context.md, then follow the instructions in diff --git a/.github/workflows/on_pr_coderabbit.yml b/.github/workflows/on_pr_coderabbit.yml index 95a17f0cb4..d983ec9bd2 100644 --- a/.github/workflows/on_pr_coderabbit.yml +++ b/.github/workflows/on_pr_coderabbit.yml @@ -25,7 +25,6 @@ permissions: contents: write pull-requests: write issues: write - id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow concurrency: group: ai-coderabbit-${{ github.event.pull_request.number }} @@ -83,6 +82,11 @@ jobs: uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + # Skip the OIDC -> Claude App token exchange, which 401s whenever + # github.actor lacks write access — here github.actor is + # coderabbitai[bot], the review submitter. AI_PR_TOKEN, not + # GITHUB_TOKEN, so the pushed fixes re-trigger CI on the PR. + github_token: ${{ secrets.AI_PR_TOKEN }} prompt: | CodeRabbit has reviewed pull request #${{ github.event.pull_request.number }} on ${{ github.repository }}. You are on that PR's branch. Follow