Claude Code GitHub Actions runs Claude Code as a step in a GitHub Actions job (anthropics/claude-code-action@v1). An event starts the run, actor checks decide whether it may continue, and GitHub and Claude tool permissions limit what it can do.1 Typical uses: turning an issue into a pull request, fixing a bug asked for in a comment, answering questions, reviewing with a skill, and scheduled reports.1
Two modes
The presence of the prompt input picks the mode; v1 has no mode input.1
| Mode | When | Behaviour |
|---|---|---|
| Interactive | No prompt | Waits for the trigger phrase (default @claude) in comments, reviews, or a new issue, and replies there |
| Automation | prompt set | Runs on the configured event, such as a pull request or schedule, and writes to the workflow log by default |
Before Claude starts, the actor must have write access (unless listed in allowed_non_write_users with a custom github_token), and bots are rejected unless listed in allowed_bots. A scheduled run is attributed to an actor, often whoever last edited the cron line.1
Permissions
What a run can do is the intersection of three layers: who may start it (actor checks), what GitHub accepts (the job’s permissions), and what Claude may invoke (--allowedTools, permissions.allow in settings, or a skill’s allowed-tools). A plain automation prompt has no shell or GitHub API tools until the workflow grants them.1 More on this pattern: Least-privilege tool access.
Setup and authentication
Both setup paths need repository admin. Quick setup runs /install-github-app in Claude Code (github.com only), which installs the app, stores a secret, and prepares a workflow pull request; manual setup installs the Claude GitHub App, adds a secret, and copies examples/claude.yml.1
| Authentication | Secret or config | Fits |
|---|---|---|
| Claude API | ANTHROPIC_API_KEY | API billing and shared automation |
| Subscription | CLAUDE_CODE_OAUTH_TOKEN | Tied to the token creator’s plan; a poor shared credential |
| Workload identity federation | No long-lived key; id-token: write | Organization deployments |
| Cloud provider | Provider OIDC; use_bedrock, use_vertex, use_foundry | Inference through Bedrock, Google Cloud, or Foundry |
Operating it
- Keep credentials in GitHub Secrets; deleting a secret does not revoke the key, so revoke it at the issuer.1
- Treat issue and comment text as untrusted (prompt injection), and require human review before merging generated changes.1
- Bound cost with specific requests, a concise
CLAUDE.md,--max-turns, workflow timeouts, and concurrency controls.1 - If CI does not run after Claude pushes, do not force the default
GITHUB_TOKENwhen app authentication is intended, and make sure CI listens to the resulting event. Public-repository fork workflows do not get secrets.1 - Migrating from
@beta: switch to@v1, dropmode, renamedirect_prompttoprompt, and move options intoclaude_args(custom_instructionsbecomes--append-system-prompt).1
Related
- Pull request auto-fix: the cloud-session way to respond to PR activity.
- Source: Claude Code GitHub Actions