-
Notifications
You must be signed in to change notification settings - Fork 568
76 lines (67 loc) · 2.13 KB
/
claude-react-on-comment.yml
File metadata and controls
76 lines (67 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: "Claude React on comment"
on:
issue_comment:
types: [created]
pull_request_review:
types: [submitted]
pull_request_review_comment:
types: [created]
permissions:
contents: write
pull-requests: write
issues: write
actions: read
concurrency:
group: claude-pr-reactions-${{ github.event.pull_request.number || github.event.issue.number }}
cancel-in-progress: false
jobs:
check-trigger:
name: "Check trigger phrase"
runs-on: ubuntu-latest
timeout-minutes: 1
outputs:
triggered: ${{ steps.check.outputs.triggered }}
steps:
- name: "Check for trigger phrase"
id: check
env:
COMMENT_BODY: ${{ github.event.comment.body || github.event.review.body || '' }}
run: |
if [ "${{ github.event.comment.user.login || github.event.review.user.login || '' }}" = "phpstan-bot" ]; then
echo "triggered=false" >> "$GITHUB_OUTPUT"
elif echo "$COMMENT_BODY" | grep -qF "@phpstan-bot"; then
echo "triggered=true" >> "$GITHUB_OUTPUT"
else
echo "triggered=false" >> "$GITHUB_OUTPUT"
fi
react:
name: "React on comment"
needs: check-trigger
if: needs.check-trigger.outputs.triggered == 'true'
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 60
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "8.4"
ini-file: development
extensions: mbstring
- uses: "ramsey/composer-install@v3"
- name: "React to feedback"
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.PHPSTAN_BOT_TOKEN }}
trigger_phrase: "@phpstan-bot"
claude_args: "--model claude-opus-4-6"
bot_name: "phpstan-bot"
bot_id: "79867460"
additional_permissions: |
actions: read