anthropics / anthropics/claude-code-action

App token exchange fails with 401 'not installed' despite confirmed GitHub App install + fresh OAuth token

未关闭
#1,683 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:installation area:permissions bug p2 provider:1p
主要语言
TypeScript
星标
8.9k
派生
2.1k
PR 合并指标
PR 指标待抓取

描述

## Summary

The `claude-code-action@v1` action consistently fails during the OIDC→app-token exchange step with:

```
App token exchange failed: 401 Unauthorized - Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
```

This happens on every run (6 consecutive attempts), including after ruling out every locally-controllable cause.

## Environment

- Repo: `ryoichi-nawa/claude-code-book-template` (personal account, not an org)
- Workflows: `.github/workflows/claude.yml` and `.github/workflows/claude-code-review.yml`, added via `/install-github-app`
- Trigger: `issue_comment` event, run id `31939606196`

## Steps already taken (all confirmed, none resolved the error)

1. Installed the Claude GitHub App at `https://github.com/apps/claude`, confirmed via `https://github.com/settings/installations` that it's listed with explicit access to this repo.
2. Fully uninstalled and reinstalled the GitHub App (to force fresh installation webhooks) — same error afterward.
3. Regenerated `CLAUDE_CODE_OAUTH_TOKEN` via `claude setup-token` and updated the repo secret with `gh secret set` — confirmed via `gh secret list` that the secret's `updated_at` timestamp changed (`2026-08-16T09:29:16Z` → `2026-08-16T10:02:53Z`). Re-ran the job with the fresh token — identical 401 error.

## Relevant log excerpt

```
Auto-detected mode: agent for event: pull_request
Requesting OIDC token...
Attempt 1 of 3...
OIDC token successfully obtained
Exchanging OIDC token for app token...
Attempt 1 of 3...
App token exchange failed: 401 Unauthorized - Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
Retrying in 5 seconds...
Attempt 1 failed: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
...
Operation failed after 3 attempts
##[error]Action failed with error: Claude Code is not installed on this repository. Please install the Claude Code GitHub App at https://github.com/apps/claude
```

## Expected behavior

Given the GitHub App is confirmed installed with access to the repo and the OAuth token is freshly issued, the app-token exchange should succeed.

## Actual behavior

401 Unauthorized on every attempt, with the same "not installed" message, regardless of app reinstall or token regeneration — suggesting a possible sync/caching issue on the backend side of the OIDC↔GitHub-App-installation lookup, rather than anything wrong with the local repo/app configuration.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。