Skip to content

Commit fa7a5ef

Browse files
committed
chore: add mention and review workflows
1 parent 670ebd9 commit fa7a5ef

2 files changed

Lines changed: 121 additions & 0 deletions

File tree

.github/workflows/mention.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: mention
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
issues:
7+
types: [opened, assigned]
8+
pull_request_review_comment:
9+
types: [created]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
comment:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || github.event.action == 'assigned' && github.event.assignee.login == 'claude[bot]')) ||
18+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
id-token: write
24+
issues: write
25+
pull-requests: write
26+
steps:
27+
- name: Checkout Repo
28+
uses: actions/checkout@v5
29+
with:
30+
fetch-depth: 1
31+
32+
- name: React on Mention
33+
uses: anthropics/claude-code-action@v1
34+
with:
35+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
36+
claude_args: >-
37+
--allowedTools
38+
"mcp__github_inline_comment__create_inline_comment,
39+
Bash(gh pr comment:*),
40+
Bash(gh pr create:*),
41+
Bash(gh pr diff:*),
42+
Bash(gh pr view:*),
43+
Bash(pnpm:*),
44+
Edit,
45+
Glob,
46+
Grep,
47+
Read,
48+
Write"

.github/workflows/review.yaml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, ready_for_review, reopened]
6+
7+
jobs:
8+
pull-request:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
actions: read
13+
contents: read
14+
id-token: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: Checkout Repo
19+
uses: actions/checkout@v5
20+
with:
21+
fetch-depth: 1
22+
23+
- name: Review Changes
24+
uses: anthropics/claude-code-action@v1
25+
with:
26+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
27+
allowed_bots: "*"
28+
track_progress: true
29+
prompt: |
30+
REPO: ${{ github.repository }}
31+
PR NUMBER: ${{ github.event.pull_request.number }}
32+
33+
Perform a comprehensive review of this pull request.
34+
35+
## Code Quality
36+
- Code quality and best practices
37+
- Potential bugs or issues
38+
- Performance considerations
39+
40+
## OWASP Top 10 Analysis
41+
- SQL Injection vulnerabilities
42+
- Cross-Site Scripting (XSS)
43+
- Broken Authentication
44+
- Sensitive Data Exposure
45+
- XML External Entities (XXE)
46+
- Broken Access Control
47+
- Security Misconfiguration
48+
- Cross-Site Request Forgery (CSRF)
49+
- Using Components with Known Vulnerabilities
50+
- Insufficient Logging & Monitoring
51+
52+
## Additional Security Checks
53+
- Hardcoded secrets or credentials
54+
- Insecure cryptographic practices
55+
- Unsafe deserialization
56+
- Server-Side Request Forgery (SSRF)
57+
- Race conditions or TOCTOU issues
58+
59+
Rate severity as: CRITICAL, HIGH, MEDIUM, LOW, or NONE.
60+
Post detailed findings with recommendations using inline comments for specific issues. Do not be noisy.
61+
62+
claude_args: >-
63+
--allowedTools
64+
"mcp__github_inline_comment__create_inline_comment,
65+
Bash(gh pr comment:*),
66+
Bash(gh pr diff:*),
67+
Bash(gh pr view:*),
68+
Bash(pnpm:*),
69+
Edit,
70+
Glob,
71+
Grep,
72+
Read,
73+
Write"

0 commit comments

Comments
 (0)