ci: add claude-code-review reusable workflow#54
Open
sydorovdmytro wants to merge 1 commit intomainfrom
Open
Conversation
Extracts the Claude Code Review workflow (automatic PR review triggered
on pull_request_target) as a reusable workflow_call workflow.
Source: identical workflow in loft-enterprise, vcluster, and vcluster-pro.
Changes from source:
- SHA-pinned actions/checkout and anthropics/claude-code-action
- Added persist-credentials: false on checkout
- Parameterized ANTHROPIC_API_KEY as a workflow_call secret
- Standardized variable quoting to ${VAR} style
Security hardening:
- Replaced gh CLI tools with local-only Read/Glob/Grep/LS and git diff/log
to prevent secret exfiltration via shell expansion
- Restore CLAUDE.md from base branch to prevent prompt injection from PRs
- Added concurrency group to cancel stale review runs
- Added timeout-minutes: 15
- Removed unused issues:read permission (least privilege)
0d81a7f to
64fb835
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
workflow_callworkflowloft-enterprise,vcluster, andvcluster-pro(automatic PR review onpull_request_target)actions/checkout@v6.0.2andanthropics/claude-code-action@v1persist-credentials: falseon checkoutANTHROPIC_API_KEYas aworkflow_callsecret (anthropic-api-key)${VAR}quotingloft-showner guard + remote setup for fork PRs)Security hardening
ghCLI tools with local-only tools (Read,Glob,Grep,LS,Bash(git diff:*),Bash(git log:*)) — prevents secret exfiltration via shell expansion ingh pr commentCLAUDE.mdfrom base branch before review — prevents prompt injection from PR headtimeout-minutes: 15— prevents runaway runner usageissues: readpermission — least privilegeCaller example
Test plan
claude-code-review/v1after mergePart of the Phase 3 GitHub Actions centralization effort.