forked from databricks/databricks-jdbc
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (53 loc) · 1.98 KB
/
Copy pathclaude-code-review.yml
File metadata and controls
59 lines (53 loc) · 1.98 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
name: Claude Code Review
on:
issue_comment:
types: [created]
jobs:
claude-review:
if: |
github.event.issue.pull_request &&
contains(github.event.comment.body, '/review') &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR')
runs-on:
group: databricks-protected-runner-group
labels: linux-ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: React to comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
COMMENT_ID: ${{ github.event.comment.id }}
run: |
gh api "repos/${REPO}/issues/comments/${COMMENT_ID}/reactions" \
-f content=eyes
- name: Get PR head SHA
id: pr
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.issue.number }}
run: |
PR_DATA=$(gh api "repos/${REPO}/pulls/${PR_NUMBER}")
echo "sha=$(echo "$PR_DATA" | jq -r .head.sha)" >> "$GITHUB_OUTPUT"
echo "number=$(echo "$PR_DATA" | jq -r .number)" >> "$GITHUB_OUTPUT"
- name: Checkout repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
# Use the commit SHA instead of the branch ref to prevent
# the branch from being moved between the API call and checkout
ref: ${{ steps.pr.outputs.sha }}
fetch-depth: 0
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@f87768c6d25f92ae6efa7175e223ef77d4cbf97f # v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
review_comment_id: ${{ github.event.comment.id }}
trigger_phrase: "/review"
timeout_minutes: 15