anthropics / anthropics/claude-code-action

Claude GitHub Action fails with exit code 1 despite valid GitHub App token and correct setup

Open
#1,155 1 comment 0 reactions 0 assignees View on GitHub
area:permissions bug p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

## Summary

Claude GitHub Action starts successfully but consistently fails with exit code 1, even though the setup appears correct and all required tokens are provided.

This does not appear to be a repository misconfiguration.

---

## What works

- Workflow triggers correctly on `issue_comment`
- `@claude` mention is detected
- Claude posts initial comment: "Claude Code is working..."
- Anthropic API key is correctly configured
- GitHub App is created and installed
- Custom GitHub App token is generated and passed explicitly

---

## Workflow

```yaml
name: Claude Code

on:
issue_comment:
types: [created]

jobs:
claude:
if: contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write

steps:
- uses: actions/create-github-app-token@v2
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: anthropics/claude-code-action@main
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
github_token: ${{ steps.app-token.outputs.token }}

Contributor guide

Open the contributing guide

Research direction

Start with the reproduced workflow, especially the `claude` job, the `actions/create-github-app-token@v2` step, and `anthropics/claude-code-action@main`. Run the workflow with the provided setup and inspect the action output around the exit code 1 failure. Done means identifying the action failure and confirming a successful run with the stated token configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.