ci: bleeding-edge agentic review pipeline (Claude + CodeRabbit autofix) - #224
Conversation
- claude-code-review.yml: PR auto-review using anthropics/claude-code-action@v1 with the official `code-review@claude-code-plugins` skill. Loop-prevention via `if: github.actor != 'coderabbitai[bot]'`, concurrency cancels stale runs, paths-ignore filters lockfile/CHANGELOG noise. Operating mode: agentic — bot pushes mechanical fixes directly to PR branch, escalates structural concerns to humans. Bounded by `--max-turns 25` per run. - coderabbit-autofix.yml: auto-comments `@coderabbitai autofix` on PR open/sync to remove the manual checkbox click. Skips bot-authored PRs and the `skip-autofix` label opt-out. - .coderabbit.yaml: fix indent bugs at L41/55/185 (silent parser failures); port qyl-grade hardening (request_changes_workflow, fail_commit_status, auto_pause_after_reviewed_commits, ~30 explicit tool disables, issue_enrichment, knowledge_base.mcp). Add path_instructions for rider-respect and release-pilot. Standard secret name (CLAUDE_CODE_OAUTH_TOKEN), zero owner-specific gates → forks work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (1).github/workflows/**⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (5)
Summary by CodeRabbit
WalkthroughAdds two GitHub Actions workflows: Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 9✅ Passed checks (9 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Review rate limit: 2/5 reviews remaining, refill in 34 minutes and 49 seconds. Comment |
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
There was a problem hiding this comment.
Pull request overview
Restores automated PR review for this plugin marketplace by reintroducing a Claude-driven review workflow, adding a CodeRabbit autofix trigger, and tightening CodeRabbit repository policy/configuration.
Changes:
- Adds a new Claude Code review workflow intended to review PRs automatically and push mechanical fixes.
- Adds a CodeRabbit autofix-trigger workflow that comments
@coderabbitai autofixon PR updates. - Expands and hardens
.coderabbit.yamlwith new review behaviors, path instructions, and tool configuration.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
.github/workflows/coderabbit-autofix.yml |
New workflow that auto-comments on PRs to trigger CodeRabbit autofix. |
.github/workflows/claude-code-review.yml |
New Claude review workflow for PR events with agentic/fix-forward behavior. |
.coderabbit.yaml |
Updates CodeRabbit review policy, path instructions, auto-review settings, and tool toggles. |
| - name: Checkout PR head | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.ref }} |
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| allowed_bots: 'dependabot[bot],renovate[bot]' |
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: Comment "@coderabbitai autofix" | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body: '@coderabbitai autofix' |
There was a problem hiding this comment.
Skipped: comment is from another GitHub bot.
| # Stack: Markdown + YAML frontmatter (skills/commands/agents) + Shell (hooks/scripts) | ||
| # CI: claude plugin validate, shellcheck, markdownlint, actionlint, jq | ||
| # Scope: 13 plugins, 28 commands, 6 skills, 25 agents — NO C#/.NET code | ||
| # Scope: 16 plugins — NO C#/.NET code |
| - label: area:rider-respect | ||
| instructions: Apply when the PR modifies files under plugins/rider-respect/. |
| - path: plugins/rider-respect/** | ||
| instructions: >- | ||
| Rider IDE dry-run plugin. Review for: hard invariant that the skill | ||
| NEVER commits, pushes, merges, or suppresses (#pragma / NoWarn / | ||
| SuppressMessage). Scope must be captured BEFORE any git stash | ||
| (stash-after-scope ordering bug). Discard command must clean | ||
| untracked files (git clean -fd) since Rider refactors can create | ||
| new .cs files. Flag any "fix" that adds suppression rather than | ||
| rewriting the diagnostic. | ||
|
|
| - path: plugins/**/bin/*.sh | ||
| instructions: >- | ||
| Shell scripts under plugin bin/ directories — executed by skills and | ||
| commands. Same shellcheck rules as scripts/. Pay special attention | ||
| to release-pilot/bin/ scripts which interact with git tags and | ||
| NuGet — flag any retag or tag-deletion logic. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.coderabbit.yaml:
- Around line 481-482: Enable yamllint by setting the yamllint.enabled flag to
true in the .coderabbit.yaml config (replace the current "yamllint: enabled:
false" entry), or if you need to limit scope, change the yamllint config to true
and add excludes for directories where it causes noise; reference the yamllint
"enabled" key in the file to locate and update the setting so YAML frontmatter
and non-workflow YAML files are linted.
In @.github/workflows/claude-code-review.yml:
- Around line 42-48: Replace the third-party action tag with a pinned commit
SHA: update the uses entry that currently reads
"anthropics/claude-code-action@v1" to the specific commit SHA for that release
(e.g., "anthropics/claude-code-action@<SHA>") so the workflow uses an immutable
reference; keep the existing inputs (claude_code_oauth_token, allowed_bots,
track_progress, plugin_marketplaces, plugins) unchanged and verify the SHA by
running git ls-remote against the anthropics/claude-code-action repo before
committing.
- Line 44: Move the secret claude_code_oauth_token out of the action's with:
block and expose it via an env: mapping instead (e.g., set an env key like
CLAUDE_CODE_OAUTH_TOKEN = ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}), then update
the action invocation to read that environment variable rather than the with:
input; confirm the action used in this workflow supports reading the token from
process.env (if it does not, keep the with: input but add a short comment
explaining why and ensure logging/sanitization).
In @.github/workflows/coderabbit-autofix.yml:
- Around line 17-21: Update the workflow's conditional that filters actors in
the `if:` block to also exclude Claude by adding the check `github.actor !=
'claude[bot]'` alongside the existing actor checks (the block containing
`github.actor != 'coderabbitai[bot]'`, `github.actor != 'dependabot[bot]'`,
`github.actor != 'renovate[bot]'`) so the `anthropics/claude-code-action` pushes
won't trigger the autofix comment; keep the existing
`!contains(github.event.pull_request.labels.*.name, 'skip-autofix')` label check
intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: efcc1a8c-196a-4848-8360-03d981a47b65
📒 Files selected for processing (3)
.coderabbit.yaml.github/workflows/claude-code-review.yml.github/workflows/coderabbit-autofix.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/**
⚙️ CodeRabbit configuration file
GitHub Actions workflows for CI, auto-merge, and AI code review. Review for: action version pinning (SHA for third-party, tags for first-party GitHub actions), proper secret handling (secrets via env: not inline, no secrets in logs), minimal permissions (principle of least privilege), proper concurrency groups on push-triggered workflows, and that security-sensitive inputs use env: variables to prevent code injection (CWE-94). Flag missing continue-on-error on non-critical steps. Flag workflows that could trigger infinite loops between AI agents.
Files:
.github/workflows/coderabbit-autofix.yml.github/workflows/claude-code-review.yml
🔇 Additional comments (7)
.github/workflows/coderabbit-autofix.yml (1)
29-38: LGTM.The
github-scriptaction is first-party (tags acceptable), permissions are minimal, and the script uses GitHub-controlled context variables — no injection risk..coderabbit.yaml (4)
195-221: Path instructions for hookify, release-pilot, and rider-respect are well-structured.The instructions capture critical invariants:
release-pilot: ghost-tag handling, bounded auto-fix, allowlist constraintsrider-respect: hard no-commit invariant, stash-after-scope ordering, clean untracked filesThese match the pre_merge_checks.title.requirements scopes added at line 343.
387-490: Tools configuration is schema-compliant and stack-appropriate.Enabled: shellcheck, actionlint, markdownlint, gitleaks, github-checks, ast-grep — matches the CI comment at line 5. All 30+ disabled tools are correctly set to
enabled: falsewith valid schema keys.
524-525: MCP usage set toauto— disables for public repos.If this is a public repo and MCP integration is desired, set
usage: enabled. Currentautosetting will disable MCP for public repositories per schema description.
527-535: Issue enrichment config is schema-compliant.
auto_enrich.enabled: truewithauto_planning.enabled: false— enriches issues without auto-generating plans.labeling.auto_apply_labels: trueenables label suggestions..github/workflows/claude-code-review.yml (2)
34-38: ⚡ Quick winNo action required —
actions/checkout@v6is the latest stable version.v6.0.2 was released 2026-01-09 and is the current stable branch. Version pinning via tag is appropriate for first-party GitHub actions.
> Likely an incorrect or invalid review comment.
49-49: ⚡ Quick win
claude-opus-4-7is a valid current model identifier as of 2026. No change needed.> Likely an incorrect or invalid review comment.
| yamllint: | ||
| enabled: false |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
yamllint disabled despite this being a YAML-heavy repo.
Disabled at line 482, but the repo contains .coderabbit.yaml, workflow files, and plugin YAML frontmatter. actionlint covers workflow YAML; general YAML linting could catch frontmatter issues in SKILL.md files.
Not blocking — actionlint + markdownlint likely sufficient. Flag if YAML frontmatter errors slip through.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.coderabbit.yaml around lines 481 - 482, Enable yamllint by setting the
yamllint.enabled flag to true in the .coderabbit.yaml config (replace the
current "yamllint: enabled: false" entry), or if you need to limit scope, change
the yamllint config to true and add excludes for directories where it causes
noise; reference the yamllint "enabled" key in the file to locate and update the
setting so YAML frontmatter and non-workflow YAML files are linted.
| if: | | ||
| github.actor != 'coderabbitai[bot]' && | ||
| github.actor != 'dependabot[bot]' && | ||
| github.actor != 'renovate[bot]' && | ||
| !contains(github.event.pull_request.labels.*.name, 'skip-autofix') |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check what actor identity anthropic's action typically uses
# by looking at recent PR activity or action documentation
gh api repos/anthropics/claude-code-action/readme --jq '.content' | base64 -d | grep -i "bot\|actor\|identity" || echo "No direct mention found in README"Repository: ANcpLua/ancplua-claude-plugins
Length of output: 166
🏁 Script executed:
# First, examine the full workflow file to see complete context
cat -n .github/workflows/coderabbit-autofix.ymlRepository: ANcpLua/ancplua-claude-plugins
Length of output: 1652
🌐 Web query:
anthropics/claude-code-action GitHub actor identity bot username
💡 Result:
The Claude Code GitHub Action’s default bot identity is: - Username: claude[bot] - GitHub user ID (bot_id): 209825114 In anthropics/claude-code-action, the action input bot_name defaults to claude[bot], and the relevant bot user ID shown for claude[bot] is 209825114. (There’s also documentation/issues noting a historical mismatch where the bot_id default may have been set incorrectly to the github-actions[bot] ID, but the intended claude bot username is still claude[bot].)
Citations:
- 1: https://github.com/anthropics/claude-code-action/blob/main/docs/faq.md
- 2: https://github.com/anthropics/claude-code-action/blob/refs/heads/main/action.yml
- 3: [BUG] CLAUDE_APP_BOT_ID constant uses github-actions[bot] ID (41898282) instead of claude[bot] ID (209825114) anthropics/claude-code-action#759
Add claude[bot] to the exclusion list to prevent redundant autofix comments.
When Claude pushes a fix via anthropics/claude-code-action, the synchronize event triggers this workflow and posts another @coderabbitai autofix comment because Claude's actor (claude[bot]) is not excluded.
Add the condition: github.actor != 'claude[bot]'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/coderabbit-autofix.yml around lines 17 - 21, Update the
workflow's conditional that filters actors in the `if:` block to also exclude
Claude by adding the check `github.actor != 'claude[bot]'` alongside the
existing actor checks (the block containing `github.actor !=
'coderabbitai[bot]'`, `github.actor != 'dependabot[bot]'`, `github.actor !=
'renovate[bot]'`) so the `anthropics/claude-code-action` pushes won't trigger
the autofix comment; keep the existing
`!contains(github.event.pull_request.labels.*.name, 'skip-autofix')` label check
intact.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dac549f8a7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| allowed_bots: 'dependabot[bot],renovate[bot]' |
There was a problem hiding this comment.
Skip Claude review on fork/Dependabot pull_request runs
This job always runs on pull_request, but in forked PR contexts (including Dependabot PRs) GitHub does not provide repository secrets and downgrades write scopes, so claude_code_oauth_token is unavailable and the agentic write path fails. The result is a consistently failing review check for those PRs instead of a clean skip; add a guard for forked heads/Dependabot or gate on token availability before invoking the action.
Useful? React with 👍 / 👎.
| if: | | ||
| github.actor != 'coderabbitai[bot]' && | ||
| github.actor != 'dependabot[bot]' && | ||
| github.actor != 'renovate[bot]' && | ||
| !contains(github.event.pull_request.labels.*.name, 'skip-autofix') |
There was a problem hiding this comment.
Prevent autofix comment job from running on forked PRs
This condition excludes a few bot actors but still runs on external fork PRs, where pull_request workflows use a read-only token and cannot create comments; issues.createComment then fails with a permissions error, leaving noisy red CI on contributor PRs. Add a fork check (or switch to a safe pull_request_target pattern) so the workflow skips when comment write access is unavailable.
Useful? React with 👍 / 👎.
…utofix)
Addresses CodeRabbit findings on this PR (also applied across all 6 PRs in the
ecosystem rollout, which collectively introduced the same pattern violations):
1. Pin anthropics/claude-code-action@v1 to commit SHA fefa07e9c665b7320f08c3b525980457f22f58aa per the
'.coderabbit.yaml' path_instructions for .github/workflows/** ('Pin third-
party actions to SHA. First-party (actions/*) tag-pin OK'). Renovate will
bump the SHA on new releases.
2. Move CLAUDE_CODE_OAUTH_TOKEN to job-level env: mapping rather than inline
with:, per the same path_instructions ('Secrets via env: not inline').
Self-correction via the agentic loop: the policy in .coderabbit.yaml flagged
my own workflow files written under that policy. Working as designed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. ⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/claude-code-review.yml:
- Line 5: The workflow is self-retriggering because it runs on synchronize and
the action itself pushes commits as github-actions[bot]; update the job-level
guard condition (the existing if: guard that checks event/branch/actor around
the push step) to also require github.actor != 'github-actions[bot]' so
bot-authored commits do not re-enter the workflow; add the expression
github.actor != 'github-actions[bot]' to the same conditional (preserving
existing checks) to block runs triggered by the bot.
- Around line 13-19: Remove the unnecessary id-token: write permission from the
workflow permissions block (delete the id-token: write entry) while retaining
actions: read so agentic mode can access workflow run data/logs; ensure the
permissions block still includes contents: write, pull-requests: write, issues:
write and actions: read as shown and that the workflow continues to use
claude_code_oauth_token authentication.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 0015f3d0-6030-4a6e-baa4-451cef9a1463
📒 Files selected for processing (1)
.github/workflows/claude-code-review.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
.github/workflows/**
⚙️ CodeRabbit configuration file
GitHub Actions workflows for CI, auto-merge, and AI code review. Review for: action version pinning (SHA for third-party, tags for first-party GitHub actions), proper secret handling (secrets via env: not inline, no secrets in logs), minimal permissions (principle of least privilege), proper concurrency groups on push-triggered workflows, and that security-sensitive inputs use env: variables to prevent code injection (CWE-94). Flag missing continue-on-error on non-critical steps. Flag workflows that could trigger infinite loops between AI agents.
Files:
.github/workflows/claude-code-review.yml
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| issues: write | ||
| id-token: write | ||
| actions: read | ||
|
|
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does anthropics/claude-code-action require GitHub Actions permission id-token: write to function, or can it run without OIDC permissions?
💡 Result:
No, anthropics/claude-code-action does not require GitHub Actions permission id-token: write to function. It can run without OIDC permissions by providing a github_token input, which bypasses the default OIDC-based authentication flow that uses the Claude GitHub App. The default authentication uses OIDC to exchange for a short-lived GitHub App token via Anthropic's endpoint (https://api.anthropic.com/api/github/github-app-token-exchange). This requires id-token: write in the workflow permissions, as explicitly stated in the official FAQ: "If you're using the default GitHub App authentication, you must add the id-token: write permission to your workflow" (result 4). However, the action supports an alternative: pass a custom GitHub token (e.g., generated via actions/create-github-app-token or ${{ secrets.GITHUB_TOKEN }}) using the github_token input. This skips OIDC entirely: "If you wish to not use the GitHub app, you can instead provide a github_token input to the action for Claude to operate with" (result 4). The action.yml confirms github_token as an optional input: "GitHub token for Claude to operate with. Only include this if you're connecting a custom GitHub app of your own!" (results 17, 19, 63). Workflow examples in the repo use ${{ secrets.GITHUB_TOKEN }} without id-token: write (result 17). Issues confirm workarounds like generating app tokens manually and passing github_token to avoid OIDC failures (results 9, 10, 60). Note: Using ${{ secrets.GITHUB_TOKEN }} inherits the workflow's declared permissions (e.g., contents: write), so ensure they match the action's needs (contents, issues, pull-requests read/write). Custom tokens require appropriate repo scopes.
Citations:
- 1: https://github.com/anthropics/claude-code-action
- 2: https://github.com/anthropics/claude-code-action/blob/main/docs/faq.md
- 3: OIDC token exchange fails with 401 when
github.actorisCopilotanthropics/claude-code-action#1017 - 4: OIDC token exchange rejects pull_request_target events anthropics/claude-code-action#713
- 5: Generated workflows missing id-token:write permission and trigger on bot's own comments anthropics/claude-code-action#625
- 6: Claude session has access to OIDC token request environment variables, allowing it to mint new tokens anthropics/claude-code-action#1010
- 7: https://github.com/anthropics/claude-code-action/tree/4bd9c2053aef2ba7e636657860ce3edcefd40d4e
- 8: https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
- 9: Error during "Exchanging OIDC token for app token..." anthropics/claude-code-action#8
- 10: https://github.com/anthropics/claude-code-action/blob/eb99fb38/src/github/token.ts
- 11: https://github.com/anthropics/claude-code-action/blob/main/action.yml
- 12: https://github.com/anthropics/claude-code-action/blob/4bd9c2053aef2ba7e636657860ce3edcefd40d4e/action.yml
🏁 Script executed:
cat -n .github/workflows/claude-code-review.ymlRepository: ANcpLua/ancplua-claude-plugins
Length of output: 3729
🌐 Web query:
anthropics/claude-code-action claude_code_oauth_token authentication flow id-token requirement
💡 Result:
For the official anthropics/claude-code-action, there is NO “id-token required” requirement specifically for claude_code_oauth_token authentication. Instead, the action’s OAuth-token support (claude_code_oauth_token) is an alternative to using an Anthropic API key, and you pass the token as an action input: - claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} (under the with: block, not env:) The id-token (GitHub Actions OIDC token) is required only when you’re using the default Claude GitHub App authentication flow (OIDC token exchange). The action docs/FAQ state that id-token: write is required for OIDC authentication so the Claude GitHub app can function. Key points about the authentication flows: 1) claude_code_oauth_token flow (Anthropic “Claude Code OAuth token”) - Configure: use with: claude_code_oauth_token: ... - Do NOT set CLAUDE_CODE_OAUTH_TOKEN in env; that can break validation because the token won’t be present to the base action. 2) Default GitHub App / OIDC flow (GitHub App token exchange) - Requires workflow permission id-token: write so the action can request an OIDC token. - If your workflow trigger/event makes the OIDC exchange fail (e.g., pull_request_target), you can see “Invalid OIDC token” errors. - If you don’t provide a github_token (custom GitHub token / app token generation), some OAuth-token setups can still attempt the GitHub App OIDC exchange first and fail until github_token is provided. So: claude_code_oauth_token does not imply an id-token requirement; id-token is tied to the GitHub App OIDC exchange path, not the Anthropic OAuth token path. Example workflow snippet (OAuth token as an input): - uses: anthropics/claude-code-action@v1 with: claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} prompt: "Review this PR" Example permissions when you are using OIDC/GitHub App auth: permissions: contents: read id-token: write
Citations:
- 1: https://github.com/anthropics/claude-code-action/blob/main/docs/faq.md
- 2: https://code.claude.com/docs/en/github-actions
- 3: https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
- 4: Generated workflow missing github_token parameter for OAuth authentication anthropics/claude-code-action#721
- 5: CLAUDE_CODE_OAUTH_TOKEN is cleared between prepare and execute phases, causing authentication failure anthropics/claude-code-action#676
- 6: OIDC token exchange rejects pull_request_target events anthropics/claude-code-action#713
🌐 Web query:
anthropics/claude-code-action required GitHub Actions permissions contents pull-requests issues actions
💡 Result:
Required GitHub Actions permissions for anthropics/claude-code-action (to let Claude Code read workflow run data/logs for PRs/issues) 1) Minimum repository permissions the Claude Code GitHub App uses (no “actions” access yet) - Contents: read & write - Pull Requests: read & write - Issues: read & write These are the “currently used” permissions for the Claude Code GitHub App. 2) GitHub Actions “actions” permission (what you need to analyze CI results/logs) - Add actions: read to your workflow/job permissions so the token can read workflow run data and logs. - Example job permissions from the action docs: permissions: contents: write pull-requests: write issues: write actions: read 3) How to express this with the action (additional_permissions) - Configure the action with additional_permissions containing actions: read. 4) Important nuance: “GitHub App token” vs “GITHUB_TOKEN” - The docs note the GitHub App can be prevented from triggering this action by other bots/apps for security, and that the app receives a short-lived token scoped to the repository. - For workflow run feedback (the “actions: read” capability), you must ensure the token used in your setup has actions: read as described above. 5) Related/adjacent permissions mentioned (not required for the core “actions: read” use case) - The action docs list additional permissions planned for future features: Actions (read) and Checks (read), Workflows (read & write). “Actions (Read)” is specifically called out as enabling access to workflow run data and logs. Answering your keywords directly - “contents pull-requests issues actions”: use contents (read/write or write depending on your needs), pull-requests (read/write), issues (read/write), and add actions: read to let Claude Code read workflow run data/logs. - “required … actions permissions contents pull-requests issues actions”: the action currently uses contents/PRs/issues read+write; actions: read is the extra permission required for workflow-run feedback.
Citations:
- 1: https://github.com/anthropics/claude-code-action/blob/main/docs/security.md
- 2: https://github.com/anthropics/claude-code-action/blob/main/docs/faq.md
- 3: https://github.com/anthropics/claude-code-action/blob/9a3c761f/docs/security.md
- 4: [FEATURE] Add actions:read permission to claude.ai/code GitHub App for workflow run feedback anthropics/claude-code-action#1014
- 5: https://github.com/akhilesharora/claude-code-action/tree/7c5a98d59d2464ae73f453c3e649f5b813374481
Remove id-token: write; keep actions: read for agentic mode.
id-token: write is unnecessary because the workflow uses claude_code_oauth_token authentication, which bypasses GitHub App OIDC. However, actions: read is required for the agentic mode to analyze workflow run data and logs.
Suggested fix
permissions:
contents: write
pull-requests: write
issues: write
- id-token: write
actions: read🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.github/workflows/claude-code-review.yml around lines 13 - 19, Remove the
unnecessary id-token: write permission from the workflow permissions block
(delete the id-token: write entry) while retaining actions: read so agentic mode
can access workflow run data/logs; ensure the permissions block still includes
contents: write, pull-requests: write, issues: write and actions: read as shown
and that the workflow continues to use claude_code_oauth_token authentication.
Closes the self-retrigger loop CodeRabbit identified: when claude-code-action pushes a mechanical fix to the PR branch, the commit is authored by github-actions[bot]. Without this guard, the synchronize event re-fires the workflow on the bot's own push, potentially looping until --max-turns kicks in. Now skips runs where the triggering actor is github-actions[bot] in addition to coderabbitai[bot]. Real human pushes still trigger review normally. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. ⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission. |
|
@coderabbitai autofix |
|
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. ⛔ CodeRabbit does not have permission to push changes to this repository. Please ensure CodeRabbit has Contents: Read and write permission. |
Stale: addressed in subsequent commits.
Summary
Restores Claude Code Review (deleted in #222) using the bleeding-edge
code-review@claude-code-pluginsskill from Anthropic's plugin marketplace, plus a CodeRabbit autofix-trigger workflow that eliminates the manual "Push a commit to this branch" checkbox.Files
.github/workflows/claude-code-review.yml(new) — PR auto-review onopened/synchronize/ready_for_review/reopened. Usesclaude-code-action@v1+ the officialcode-reviewskill. Operating mode: agentic — Claude pushes mechanical fixes directly to the PR branch and escalates only structural concerns to humans..github/workflows/coderabbit-autofix.yml(new) — auto-comments@coderabbitai autofixon every PR open/sync. CodeRabbit then pushes its fix as a commit. No human click needed..coderabbit.yaml— fixes 3 silent YAML indent bugs at L41/55/185 (parser was likely dropping config from those points). Adds qyl-grade hardening:request_changes_workflow,fail_commit_status,auto_pause_after_reviewed_commits, ~30 explicit tool disables,issue_enrichment,knowledge_base.mcp. Addspath_instructionsforrider-respectandrelease-pilot.Safety mechanics
if: github.actor != 'coderabbitai[bot]'breaks Claude↔CodeRabbit ping-pong loopsconcurrency: cancel-in-progresskills stale review runs when new pushes land--max-turns 25bounds compute per workflow runpaths-ignoreskips lockfile/CHANGELOG-only changesallowed_bots: 'dependabot[bot],renovate[bot]'lets bot PRs get reviewed safelyskip-review/skip-autofixlabel opt-outs for human overrideFork compatibility
Standard secret name (
CLAUDE_CODE_OAUTH_TOKEN), zeroif author == 'ANcpLua'gates. Anyone forking gets the same pipeline as soon as they set the secret.Test plan