-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (55 loc) · 2.89 KB
/
Copy pathclaude.yml
File metadata and controls
61 lines (55 loc) · 2.89 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
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
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')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
show_full_output: true
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# The Action does NOT read .claude/settings.json for its tool gating -- that file
# only saves prompts when someone runs Claude Code locally in this repo. What gates
# the Action is claude_args, which is appended verbatim after the action's own flags,
# and repeated --allowedTools accumulate rather than replace.
#
# Without this, every dotnet invocation is refused and the run is useless on a .NET
# repository: no build, no tests, so nothing it reports can have been verified.
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://code.claude.com/docs/en/cli-reference for available options
# --model pinned EXPLICITLY. Left to default, the CLI resolved to claude-opus-5[1m]
# -- the 1M-context variant, which this key cannot use -- and the first API call died
# in under half a second: is_error, zero cost, empty modelUsage, and the real error
# hidden by the default output redaction. show_full_output is on for the same reason:
# a failure that cannot be read from the log gets diagnosed by archaeology instead.
claude_args: '--allowedTools "Bash(dotnet:*),Bash(gh pr edit:*),Bash(gh pr ready:*),Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment:*),Task"'