anthropics / anthropics/claude-code-action

Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable

Abierto
#649 4 comentarios 0 reacciones 0 asignados Ver en GitHub
area:installation area:permissions bug p1 provider:1p
Lenguaje dominante
TypeScript
Estrellas
8.9k
Forks
2.1k
Merge medio
3 d 9 h
PR fusionados (30 d)
10

Descripción

**Describe the bug**

I'm trying to run the action in a [workflow step](https://github.com/mozilla/neqo/actions/runs/18904110661/workflow?pr=3089#L30-L82) in `mozilla/neqo`.

**Expected behavior**

I'd expect to get a code review.

**Screenshots**

I'm getting an [error](https://github.com/mozilla/neqo/actions/runs/18904110661/job/53962702755#step:3:191):

```
Run bun run ${GITHUB_ACTION_PATH}/src/entrypoints/prepare.ts
Auto-detected mode: tag for event: pull_request
Requesting OIDC token...
Attempt 1 of 3...
Failed to get OIDC token: 66 | const id_token = yield OidcClient.getCall(id_token_url);
67 | (0, core_1.setSecret)(id_token);
68 | return id_token;
69 | }
70 | catch (error) {
71 | throw new Error(`Error message: ${error.message}`);
^
error: Error message: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/oidc-utils.js:71:23)
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/oidc-utils.js:8:71)
at new Promise (1:11)
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/oidc-utils.js:4:12)
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/core.js:319:46)
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/core.js:31:71)
at new Promise (1:11)
at (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@actions/core/lib/core.js:27:12)
at getOidcToken (/home/runner/work/_actions/anthropics/claude-code-action/v1/src/github/token.ts:8:34)
at getOidcToken (/home/runner/work/_actions/anthropics/claude-code-action/v1/src/github/token.ts:6:28)

Attempt 1 failed: Could not fetch an OIDC token. Did you remember to add `id-token: write` to your workflow permissions?
```

The workflow [has the correct permissions](https://github.com/mozilla/neqo/actions/runs/18904110661/workflow?pr=3089#L12-L15) (even at the workflow level, which is not really recommended).

The `ANTHROPIC_API_KEY` repo secret is set.

**Workflow yml file**
```yaml
- name: Run Claude Code Review
id: claude
# TODO: Would like to pin this, but the Mozilla org allowlist requires "anthropics/claude-code-action@v1"
uses: anthropics/claude-code-action@v1 # zizmor: ignore[unpinned-uses]
with:
track_progress: true
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
use_sticky_comment: true
use_commit_signing: true
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
```
**API Provider**

[X] Anthropic First-Party API (default)

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.