Skip to content

Commit 95afa53

Browse files
authored
Chore(ci): adding github actions for triage and reviews (#119)
* chore(ci): adding triage labeller * chore(ci): use claude code for review+triage
1 parent 96b598c commit 95afa53

File tree

2 files changed

+139
-0
lines changed

2 files changed

+139
-0
lines changed

.github/workflows/review.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
review:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
permissions:
13+
contents: read
14+
pull-requests: write
15+
id-token: write
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 1
20+
21+
- uses: anthropics/claude-code-action@v1
22+
env:
23+
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
24+
ANTHROPIC_MODEL: ${{ secrets.ANTHROPIC_MODEL }}
25+
ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
26+
with:
27+
anthropic_api_key: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
28+
prompt: |
29+
REPO: ${{ github.repository }}
30+
PR NUMBER: ${{ github.event.pull_request.number }}
31+
AUTHOR: ${{ github.event.pull_request.user.login }}
32+
33+
Please review this pull request with a focus on:
34+
- Code quality and best practices
35+
- Potential bugs or issues
36+
- Security implications
37+
- Performance considerations
38+
- Potential breaking changes
39+
- Developer experience and documentation
40+
41+
Check contribution guidelines: ./docs/docs/contributing.md
42+
Website documentation guidelines: ./docs/CLAUDE.md
43+
If you need more context on the project, read the LLMs documentation: ./docs/static/llms.txt
44+
45+
Note: The PR branch is already checked out in the current working directory.
46+
47+
Use `gh pr comment` for top-level feedback.
48+
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific code issues.
49+
Only post GitHub comments - don't submit review text as messages.
50+
Be welcoming but thorough in your review. Use inline comments for code-specific feedback.
51+
52+
claude_args: |
53+
--mcp-config '{"mcpServers": {"sequential-thinking": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]}}}'
54+
--allowedTools "mcp__github_inline_comment__create_inline_comment,mcp__sequential-thinking__sequentialthinking,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh issue:*),Bash(gh search:*)"

.github/workflows/triage.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#
2+
# https://github.blog/open-source/maintainers/how-github-models-can-help-open-source-maintainers-focus-on-what-matters/
3+
#
4+
5+
name: Triage
6+
7+
on:
8+
issues:
9+
types: [opened, reopened]
10+
pull_request:
11+
types: [opened, reopened]
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.event.issue.number }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
# triage:
19+
# if: ${{ github.event.issue.user.type != 'Bot' }}
20+
# runs-on: ubuntu-latest
21+
# permissions:
22+
# models: read
23+
# issues: write
24+
# steps:
25+
# - uses: pelikhan/action-genai-issue-dedup@v0
26+
# with:
27+
# github_token: ${{ secrets.GITHUB_TOKEN }}
28+
# labels: "auto"
29+
# count: "50"
30+
# since: "180d"
31+
32+
triage:
33+
runs-on: ubuntu-latest
34+
strategy:
35+
fail-fast: false
36+
permissions:
37+
issues: write
38+
id-token: write
39+
steps:
40+
- name: Determine body and id
41+
env:
42+
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
43+
ANTHROPIC_MODEL: ${{ secrets.ANTHROPIC_MODEL }}
44+
ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
45+
id: vars
46+
run: |
47+
if [ "${{ github.event_name }}" = "issues" ]; then
48+
echo "NBR=${{ github.event.issue.number }}" >> $GITHUB_ENV
49+
echo "TITLE=${{ github.event.issue.title }}" >> $GITHUB_ENV
50+
echo "BODY=${{ github.event.issue.body }}" >> $GITHUB_ENV
51+
echo "AUTHOR=${{ github.event.issue.user.login }}" >> $GITHUB_ENV
52+
elif [ "${{ github.event_name }}" = "pull_request" ]; then
53+
echo "NBR=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
54+
echo "TITLE=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
55+
echo "BODY=${{ github.event.pull_request.body }}" >> $GITHUB_ENV
56+
echo "AUTHOR=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
57+
fi
58+
59+
- uses: anthropics/claude-code-action@v1
60+
with:
61+
anthropic_api_key: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
62+
prompt: |
63+
REPO: ${{ github.repository }}
64+
TITLE: ${{ vars.TITLE }}
65+
BODY: ${{ vars.BODY }}
66+
ISSUE/PR NUMBER: ${{ vars.NBR }}
67+
AUTHOR: ${{ vars.AUTHOR }}
68+
69+
If you need more context on the project, read the LLMs documentation: ./docs/static/llms.txt
70+
71+
List labels for this repository: `gh label list`
72+
73+
Analyze this new issue and:
74+
1. Determine if it's a bug report, feature request, or question
75+
2. Suggest appropriate labels
76+
3. Check if it duplicates existing issues
77+
78+
Based on your analysis, add the appropriate labels using:
79+
`gh issue edit [number] --add-label "label1,label2"`
80+
81+
If it appears to be a duplicate, post a comment mentioning the original issue.
82+
83+
claude_args: |
84+
--mcp-config '{"mcpServers": {"sequential-thinking": {"command": "npx", "args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]}}}'
85+
--allowedTools "mcp__sequential-thinking__sequentialthinking,Bash(gh issue:*),Bash(gh search:*),Bash(gh label list)"

0 commit comments

Comments
 (0)