Skip to content

Add Claude Code GitHub Workflow - #1470

Merged
cristianrgreco merged 3 commits into
mainfrom
add-claude-github-actions-1790427202079
Sep 26, 2026
Merged

cristianrgreco merged 3 commits into
mainfrom
add-claude-github-actions-1790427202079

Conversation

@cristianrgreco

Copy link
Copy Markdown
Collaborator

🤖 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 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.

After merging this PR, let's try mentioning @claude in a comment on any PR to get started!

@netlify

netlify Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit 3a09245
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/6ab7c37c06a8a70008688f45
😎 Deploy Preview https://deploy-preview-1470--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cristianrgreco cristianrgreco added maintenance Improvements that do not change functionality patch Backward compatible bug fix labels Sep 26, 2026
@coderabbitai

coderabbitai Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

📝 Walkthrough

Walkthrough

The pull request adds two GitHub Actions workflows. One runs Claude Code Review for selected pull-request events and permits inline comments. The other invokes Claude Code for selected issue and review activity when the configured content contains @claude.

Priority: ⬇️ Low

Merge Risk: 🟡 Moderate · up to 19dc7

Fork reviews may fail, issue assignments will not invoke Claude as configured, and bot accounts without write access may trigger Claude. Resolve the trigger and access-control behavior before merging.

Security Architecture Review

Security architecture risk: 🟡 Moderate · up to 19dc7

The new workflows can run in response to pull requests and mention-bearing comments while supplying a stored credential to an externally maintained action. Repository-token permissions are mostly read-only, but the comment workflow does not itself check who made a mention, and the action is not pinned to an immutable revision.

Retained concerns

  • Medium · security · observed: The new automatic PR-review job passes an OAuth secret to anthropics/claude-code-action@v1 and selects a remote review plugin without an immutable revision. A change to the fetched action or plugin could change behavior at this credential boundary; compromise or exfiltration is a potential outcome, not an observed event.
  • Medium · security · observed: The new issue and review workflow selects jobs by event type and the presence of @claude, without a visible actor-authorization condition before invoking the credential-bearing action. Whether the action applies its own effective authorization is unresolved.
Security review details

Security Blast Radius

  • inferred — Matching issue or review content can schedule the mention job without a workflow-level check of the author's privileges. The independently attackable scope is therefore broader than the PR description's claimed write-access-only trigger, although action-internal checks and the OAuth credential's authority remain unknown. OIDC minting permission alone does not prove access to another environment.

Security Findings and Attack Paths

  • observed — The retained review-workflow findings identify the mutable action and OAuth-secret handoff. Their shared attack path requires a harmful change or compromise of the fetched dependency; the source does not show an actual credential leak.
  • inferred — The mention workflow visibly lacks an actor gate, but the candidate concerning its resulting privileged outcome is deferred, not verified. Establishing that outcome requires the external action's authorization and token-handling behavior.

Trust Boundaries and Controls

  • observed — The visible controls are event and content conditions, mostly read-only GitHub permissions, and a review-job allowed-tools setting. No workflow-level author check precedes the mention job's secret-bearing action; no visible setting establishes the OAuth scopes or OIDC trust policy.

Resilience and Maintainability Implications

  • inferred — The workflows do not specify an idempotency or recovery path for intended PR comments. The review output's authorization and behavior after interruption or repetition depend on the external action; no security-review completion guarantee can be inferred from this configuration.

Hardening Proposals

  • proposed — Enforce the intended actor or association policy before the mention job receives the secret, and verify whether the external action applies an additional authorization check.
  • proposed — Pin executable dependencies and review-plugin content to vetted immutable revisions where supported; establish the OAuth scope, OIDC trust, and credential used for inline comments before relying on these workflows as controlled automation.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding Claude Code GitHub workflows. It is concise and related to both workflow files.
Description check ✅ Passed The description directly explains the Claude Code integration, workflow triggers, security model, and post-merge behavior described by the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 713435c3-b7f1-44fe-ad46-ba98c25879a8

📥 Commits

Reviewing files that changed from the base of the PR and between 47d494f and 19dc71d.

📒 Files selected for processing (2)
  • .github/workflows/claude-code-review.yml
  • .github/workflows/claude.yml

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +4 to +5
pull_request:
types: [opened, synchronize, ready_for_review, reopened]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle pull requests from forks.

When a fork triggers this pull_request workflow, GitHub withholds CLAUDE_CODE_OAUTH_TOKEN. The review action cannot authenticate for those pull requests. If fork reviews are required, use a design that obtains credentials without exposing them to untrusted PR code. Otherwise, exclude fork PRs so the workflow does not run without its required credential. (docs.github.com)

Comment thread .github/workflows/claude-code-review.yml Outdated
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove or configure the issue-assignment trigger.

When someone assigns an issue whose title or body contains @claude, this job starts. The action's v1 mention check only accepts issue title or body mentions on opened events. On assigned, it requires a matching assignee_trigger, which this workflow does not set. Remove assigned if assignments should not invoke Claude, or configure an assignee trigger and align the job condition with it. (raw.githubusercontent.com)

Comment thread .github/workflows/claude.yml Outdated
- Remove the automated review workflow; reviews are on demand via @claude
- Only run the @claude workflow for cristianrgreco
- Add AGENTS.md rules for running as the @claude GitHub Action
@cristianrgreco
cristianrgreco merged commit dfa3478 into main Sep 26, 2026
13 checks passed
@cristianrgreco
cristianrgreco deleted the add-claude-github-actions-1790427202079 branch September 26, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Improvements that do not change functionality patch Backward compatible bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant