Add claude GitHub actions 1769016624918#1922
Conversation
|
@claude does this look good |
| @@ -0,0 +1,43 @@ | |||
| name: Claude Code Review | |||
There was a problem hiding this comment.
Post the source of this file in the header, please.
| # Optional: Only run on specific file changes | ||
| # paths: | ||
| # - "src/**/*.ts" | ||
| # - "src/**/*.tsx" | ||
| # - "src/**/*.js" | ||
| # - "src/**/*.jsx" |
There was a problem hiding this comment.
Drop comments that came with the template, please.
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
|
|
||
| # This is an optional setting that allows Claude to read CI results on PRs | ||
| additional_permissions: | | ||
| actions: read |
There was a problem hiding this comment.
Is Claude able to change branch here, tho?
There was a problem hiding this comment.
No — actions: read has nothing to do with branches. It only enables reading CI/workflow results (run statuses, job details, logs). The additional_permissions input spins up a GitHub CI MCP server that gives Claude three read-only tools: get_ci_status, get_workflow_run_details, and download_job_log. Branch operations would require contents: write, which we don't grant.
Also addressed the other two comments (added source headers, removed template boilerplate).
There was a problem hiding this comment.
woops claude posted this without me seeing it
Motivation and Context
Adds GitHub Actions workflows to enable Claude Code integration on the repository.
Workflows
claude.yml— Interactive assistantTriggered by
@claudementions in issue comments, PR comments, and PR reviews. Uses the Claude Code GitHub App for authentication, which provides its own write-capable token. Commit signing is enabled via GitHub API (use_commit_signing: true). Also hasactions: readto let Claude read CI results.Usage on PRs (upstream branches):
@claude fix thisor@claude do Xon a PRUsage on issues:
@claude please fixon an issueclaude/prefixed branch, commits changes, and posts a link to create a PR (human-in-the-loop for PR creation)claude-code-review.yml— Automated code reviewRuns automatically on PR open/sync. Read-only permissions. Uses the code-review plugin.
Limitations
use_commit_signinguses the GitHub API for commits, so Claude cannot perform complex git operations (rebase, cherry-pick, conflict resolution). For full git CLI support, anssh_signing_keywould need to be configured instead.contributor:feature/branch). The GitHub App token is scoped to this repo only. On fork PRs, Claude would create a new branch on the upstream repo instead.Prerequisites
ANTHROPIC_API_KEYmust be configured as a repo secretTypes of changes
Checklist
AI Disclaimer