-
Notifications
You must be signed in to change notification settings - Fork 498
60 lines (54 loc) · 2.17 KB
/
claude.yml
File metadata and controls
60 lines (54 loc) · 2.17 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
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software will be governed
# by the Apache License, Version 2.0.
name: Claude Code
on:
# GitHub treats PR timeline comments as issue comments
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
pull_request_review:
types: [submitted]
concurrency:
group: claude-${{ github.event.issue.number || github.event.pull_request.number }}
cancel-in-progress: false
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
pull-requests: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- name: Checkout PR branch
if: github.event.issue.pull_request
run: gh pr checkout ${{ github.event.issue.number }}
env:
GH_TOKEN: ${{ github.token }}
- name: Run Claude Code
id: claude
# We use a fork of anthropics/claude-code-action until it is updated to work with fork PRs
# See https://github.com/MaterializeInc/claude-code-action/blob/mz-patches/README.md for details.
uses: MaterializeInc/claude-code-action@0433f2aa93835ea8b1de27f6ed7a48724b2d510a
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
additional_permissions: |
actions: read
claude_args: '--allowed-tools Bash(gh pr:*) Edit Read Glob Grep'