Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/claude-code-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Claude Code Review

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

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/claude-code-review.yml

Repository: roadrunner-server/http

Length of output: 1806


Add fork PR guard to prevent secret access failures on external PRs.

The workflow triggers on all PRs (line 4) but line 38 requires CLAUDE_CODE_OAUTH_TOKEN secret, which is inaccessible during fork PR runs. This causes predictable failures and blocks the external contribution flow. Add the fork guard to skip the job on fork PRs:

jobs:
  claude-review:
+   if: ${{ github.event.pull_request.head.repo.fork == false }}
    runs-on: ubuntu-latest
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/claude-code-review.yml around lines 4 - 5, The workflow
triggers on pull_request but references the secret CLAUDE_CODE_OAUTH_TOKEN,
which is inaccessible for forked PRs; add a fork-PR guard by adding a job-level
condition that only runs when the PR head repo equals the base repo (e.g. if:
github.event.pull_request.head.repo.full_name == github.repository) around the
job that uses CLAUDE_CODE_OAUTH_TOKEN so external fork PRs are skipped and don't
attempt to access the secret.

# Optional: Only run on specific file changes
Comment thread
rustatian marked this conversation as resolved.
# paths:
# - "src/**/*.ts"
# - "src/**/*.tsx"
# - "src/**/*.js"
# - "src/**/*.jsx"

jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'

runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
Comment thread
rustatian marked this conversation as resolved.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/claude-code-review.yml | sed -n '25,40p'

Repository: roadrunner-server/http

Length of output: 668


Pin Actions to immutable commit SHAs instead of floating tags.

Both actions/checkout@v4 (line 30) and anthropics/claude-code-action@v1 (line 36) use mutable version tags. Pin to full commit SHAs to prevent supply chain drift—floating tags can be retargeted by upstream maintainers without your knowledge, potentially executing unintended code in workflows with elevated permissions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/claude-code-review.yml at line 30, Replace the mutable
action tags with immutable commit SHAs: locate the workflow entries that
reference uses: actions/checkout@v4 and uses: anthropics/claude-code-action@v1
and update each to the corresponding full commit SHA for that release (e.g.,
uses: actions/checkout@<full-commit-sha> and uses:
anthropics/claude-code-action@<full-commit-sha>) so the workflow pins to exact
commits and prevents supply-chain drift.

with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
Comment thread
rustatian marked this conversation as resolved.
plugins: 'code-review@claude-code-plugins'
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options

50 changes: 50 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
Comment thread
rustatian marked this conversation as resolved.

jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
Comment thread
rustatian marked this conversation as resolved.
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
Comment thread
rustatian marked this conversation as resolved.
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
Comment thread
rustatian marked this conversation as resolved.
steps:
- name: Checkout repository
uses: actions/checkout@v4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/claude.yml

Repository: roadrunner-server/http

Length of output: 2301


Pin workflow actions to commit SHAs instead of floating tags.

Line 29 uses actions/checkout@v4 and line 35 uses anthropics/claude-code-action@v1. Floating tags can be force-pushed or compromised. Pin these to exact commit SHAs (e.g., actions/checkout@a5ac7e51b41094c5405359c97429f3dd38146b4a) for stronger CI supply-chain security guarantees.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/claude.yml at line 29, Replace floating action tags with
exact commit SHAs: change usages of actions/checkout@v4 and
anthropics/claude-code-action@v1 to their corresponding commit SHAs (e.g.,
actions/checkout@<commit-sha>, anthropics/claude-code-action@<commit-sha>) so
the workflow pins the exact commits; update the two occurrences (the
actions/checkout and anthropics/claude-code-action entries) to use verified
commit SHAs instead of the v4/v1 tags.

with:
fetch-depth: 1

Comment thread
rustatian marked this conversation as resolved.
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

Loading