Skip to content

Commit 4e3fdb8

Browse files
authored
Add Claude Code GitHub Workflow (#700)
## 🤖 Installing Claude Code GitHub App This PR adds a GitHub Actions workflow that enables Claude Code integration in our repository. ### What is Claude Code? [Claude Code](https://claude.com/claude-code) is an AI coding agent that can help with: - Bug fixes and improvements - Documentation updates - Implementing new features - Code reviews and suggestions - Writing tests - And more! ### How it works Once this PR is merged, we'll be able to interact with Claude by mentioning @claude in a pull request or issue comment. Once the workflow is triggered, Claude will analyze the comment and surrounding context, and execute on the request in a GitHub action. ### Important Notes - **This workflow won't take effect until this PR is merged** - **@claude mentions won't work until after the merge is complete** - The workflow runs automatically whenever Claude is mentioned in PR or issue comments - Claude gets access to the entire PR or issue context including files, diffs, and previous comments ### Security - Our Anthropic API key is securely stored as a GitHub Actions secret - Only users with write access to the repository can trigger the workflow - All Claude runs are stored in the GitHub Actions run history - Claude's default tools are limited to reading/writing files and interacting with our repo by creating comments, branches, and commits. - We can add more allowed tools by adding them to the workflow file like: ``` allowed_tools: Bash(npm install),Bash(npm run build),Bash(npm run lint),Bash(npm run test) ``` There's more information in the [Claude Code action repo](https://github.com/anthropics/claude-code-action). After merging this PR, let's try mentioning @claude in a comment on any PR to get started! <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added automated code review workflow to the CI/CD pipeline for pull request validation. * Streamlined existing workflow configurations with updated dependency management and improved action setup. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 25ec963 + 3c16657 commit 4e3fdb8

1 file changed

Lines changed: 3 additions & 57 deletions

File tree

.github/workflows/claude.yml

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -26,67 +26,13 @@ jobs:
2626
actions: read # Required for Claude to read CI results on PRs
2727
steps:
2828
- name: Checkout repository
29-
uses: actions/checkout@v6
29+
uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 1
3232

33-
# TEMPORARY diagnostic. Verifies whether the OAuth token works against
34-
# `claude --print` directly on the runner (i.e., bypassing the action /
35-
# agent SDK entirely), so we can localize the failure to either:
36-
# - SDK auth-forwarding (diag passes, main fails), or
37-
# - runner ↔ Anthropic OAuth backend (diag fails, main fails).
38-
#
39-
# Split into two steps so the OAuth token is never present in the env
40-
# of `curl | bash` or its subprocesses (Codex P2): the installer runs
41-
# without the secret; only the verify step has it, and only for the
42-
# single claude invocation. Both diagnostic steps are
43-
# `continue-on-error: true` so neither a transient install failure nor
44-
# a runner-side OAuth failure can short-circuit `Run Claude Code` —
45-
# both step results need to be observed for the isolation logic to
46-
# work, and temporary diagnostic infrastructure must not block normal
47-
# `@claude` handling (Codex P1, both rounds).
48-
#
49-
# Token-leak hardening:
50-
# - secret is scoped to the verify step only
51-
# - never enables `set -x`; explicit `set +x` defends against
52-
# ACTIONS_STEP_DEBUG also enabling xtrace
53-
# - token reaches `claude` only via env, never as a command-line arg
54-
# - no --debug / --verbose on `claude`
55-
# - HOME is an ephemeral tmp dir; runner is destroyed after the job
56-
# - GitHub Actions secret-masking covers any literal occurrence anyway
57-
#
58-
# Remove these two steps (and rotate CLAUDE_CODE_OAUTH_TOKEN) once the
59-
# diagnostic question is answered.
60-
- name: Install Claude CLI for diag (no secrets in env)
61-
continue-on-error: true
62-
run: |
63-
set -euo pipefail
64-
set +x
65-
curl -fsSL https://claude.ai/install.sh | bash -s -- 2.1.119 >/dev/null 2>&1
66-
67-
- name: Verify OAuth on the runner (diag only)
68-
continue-on-error: true
69-
env:
70-
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
71-
run: |
72-
set -euo pipefail
73-
set +x
74-
export PATH="$HOME/.local/bin:$PATH"
75-
TMPHOME="$(mktemp -d)"
76-
HOME="$TMPHOME" ANTHROPIC_API_KEY="" claude --print "ok"
77-
7833
- name: Run Claude Code
7934
id: claude
80-
# Pinned to v1.0.107 + explicit env. As of 2026-04-28, the OAuth token
81-
# passed only via the `with:` input is not reaching the Claude Code
82-
# child process spawned by the agent SDK's query() — the SDK throws
83-
# `Could not resolve [authentication]` even though the same token
84-
# works locally with `claude --print`. Setting CLAUDE_CODE_OAUTH_TOKEN
85-
# in the step's env: forces it onto process.env so parse-sdk-options
86-
# forwards it to the child. Revisit once upstream ships a fix.
87-
uses: anthropics/claude-code-action@7eab1296cc65117d50ac2a2fa5f00a30ec84d3d5 # v1.0.107
88-
env:
89-
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
35+
uses: anthropics/claude-code-action@v1
9036
with:
9137
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
9238

@@ -100,5 +46,5 @@ jobs:
10046
# Optional: Add claude_args to customize behavior and configuration
10147
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
10248
# or https://code.claude.com/docs/en/cli-reference for available options
103-
# claude_args: '--allowed-tools Bash(gh pr:*)'
49+
# claude_args: '--allowed-tools Bash(gh pr *)'
10450

0 commit comments

Comments
 (0)