Skip to content

Commit 8a4acfc

Browse files
mfoclaude
andcommitted
Add Claude Code security review workflow
Run AI-powered security analysis on PRs after approval. Fails the check if vulnerabilities are found, with admin bypass via branch protection rules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a40b9d8 commit 8a4acfc

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Claude Code Security Review
2+
3+
on:
4+
pull_request_review:
5+
types: [submitted]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
11+
jobs:
12+
security-review:
13+
if: github.event.review.state == 'approved'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
ref: ${{ github.event.pull_request.head.sha }}
19+
fetch-depth: 2
20+
21+
- uses: anthropics/claude-code-security-review@main
22+
id: scan
23+
with:
24+
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
25+
26+
- name: Fail if security findings
27+
if: steps.scan.outputs.findings-count > 0
28+
run: |
29+
echo "::error::Security review found ${{ steps.scan.outputs.findings-count }} finding(s). Review the comments on this PR."
30+
exit 1

0 commit comments

Comments
 (0)