-
Notifications
You must be signed in to change notification settings - Fork 4
108 lines (99 loc) · 4.06 KB
/
_claude-code.yml
File metadata and controls
108 lines (99 loc) · 4.06 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: "> Claude Code"
on:
workflow_call:
inputs:
mode:
description: 'Mode: interactive or automation'
required: true
type: string
prompt:
description: 'Prompt for automation mode'
required: false
type: string
max_turns:
description: 'Maximum number of turns for Claude'
required: false
default: '200'
type: string
allowed_tools:
description: 'Allowed tools for Claude'
required: false
default: 'mcp__github_inline_comment__create_inline_comment,Read,Write,Edit,MultiEdit,Glob,Grep,LS,WebFetch,WebSearch,Bash(git:*),Bash(bun:*),Bash(npm:*),Bash(npx:*),Bash(gh:*),Bash(uv:*),Bash(make:*),Bash(export:*)'
type: string
track_progress:
description: 'Track progress (set to false for workflow_dispatch)'
required: false
default: true
type: boolean
use_sticky_comment:
description: 'Use just one comment to deliver PR comments (only applies for pull_request event workflows)'
required: false
default: false
type: boolean
secrets:
ANTHROPIC_API_KEY:
required: true
jobs:
claude-code:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: ${{ inputs.mode == 'interactive' && 0 || 1 }}
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version-file: "pyproject.toml"
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install dev tools
shell: bash
run: .github/workflows/_install_dev_tools.bash
- name: Install Python, venv and dependencies
shell: bash
run: uv sync --all-extras --frozen --link-mode=copy
- name: Setup display
uses: pyvista/setup-headless-display-action@7d84ae825e6d9297a8e99bdbbae20d1b919a0b19 # v4.2
- name: Print development version info
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
shell: bash
run: |
TOML_VERSION=$(uv run python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "Development build - Current version in pyproject.toml: $TOML_VERSION"
- name: Run Claude Code (Interactive Mode)
if: inputs.mode == 'interactive'
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
track_progress: ${{ inputs.track_progress }}
additional_permissions: |
actions: read
allowed_bots: "dependabot[bot],renovate[bot]"
claude_args: >-
--max-turns ${{ inputs.max_turns }}
--model claude-sonnet-4-5-20250929
--allowed-tools "${{ inputs.allowed_tools }}"
--system-prompt "Read the CLAUDE.md file in the root folder of this repository and explicitely acknowledge you will apply **all** guidance therein and in **all** linked documents."
- name: Run Claude Code (Automation Mode)
if: inputs.mode == 'automation'
uses: anthropics/claude-code-action@v1.0.48
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
track_progress: ${{ inputs.track_progress }}
use_sticky_comment: ${{ inputs.use_sticky_comment }}
additional_permissions: |
actions: read
allowed_bots: "dependabot[bot],renovate[bot]"
claude_args: >-
--max-turns ${{ inputs.max_turns }}
--model claude-sonnet-4-5-20250929
--allowed-tools "${{ inputs.allowed_tools }}"
--system-prompt "Read the CLAUDE.md file in this repository and explicitely acknowledge you will apply the guidance therein."
prompt: ${{ inputs.prompt }}