-
Notifications
You must be signed in to change notification settings - Fork 0
393 lines (382 loc) · 15.7 KB
/
Copy pathreview.yml
File metadata and controls
393 lines (382 loc) · 15.7 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
name: Kyosei Review
on:
workflow_call:
# At least one secret is required.
# Typically only one is needed.
# If multiple are provided they are passed through to claude-code-action as-is.
secrets:
claude_code_oauth_token:
description: Claude Code OAuth token
required: false
anthropic_api_key:
description: Anthropic API key (alternative to OAuth token)
required: false
custom_github_token:
description: >-
GitHub token for API access.
If omitted, claude-code-action uses Claude GitHub App token (claude[bot]).
Provide explicitly to use a custom token or github.token instead.
required: false
inputs:
# Authentication
use_bedrock:
description: Use Amazon Bedrock with OIDC authentication
type: boolean
required: false
default: false
use_vertex:
description: Use Google Vertex AI with OIDC authentication
type: boolean
required: false
default: false
use_foundry:
description: Use Microsoft Foundry with OIDC authentication
type: boolean
required: false
default: false
# Claude Code Action pass-through
allowed_bots:
description: >-
Comma-separated list of allowed bot usernames, or '*' to allow all bots.
Defaults to '*' because bots are not inherently more dangerous than humans.
type: string
required: false
default: "*"
allowed_non_write_users:
description: >-
Comma-separated list of users without write permission who are allowed to trigger Claude,
or '*' to allow all. Only works when custom_github_token is provided.
Enables bubblewrap sandbox and env scrubbing for safety.
type: string
required: false
default: ""
include_comments_by_actor:
description: >-
Filter to include only comments from specific actors.
Supports wildcards (e.g. '*[bot]'). Empty means include all.
type: string
required: false
default: ""
exclude_comments_by_actor:
description: >-
Filter to exclude comments from specific actors.
Supports wildcards. Exclusion takes precedence over inclusion.
type: string
required: false
default: ""
additional_permissions:
description: >-
Additional GitHub permissions for the App token (newline-separated 'key: value').
Example: 'actions: read' enables CI/CD failure analysis.
Only effective with OIDC token exchange (ignored when custom_github_token is set).
type: string
required: false
default: ""
settings:
description: >-
Claude Code settings as a JSON object, or a path to a file containing one.
The job fails when it is neither, because the value is parsed here
to merge it with the `permissions.additionalDirectories` built from
the `additional_directories` input.
Also merged with existing settings (input takes precedence).
Can configure hooks, env, MCP settings, etc.
type: string
required: false
default: ""
# Claude Code configuration
model:
description: Claude model to use
type: string
required: false
default: "opus"
effort:
description: >-
Reasoning effort level for the top-level orchestrator session
(low, medium, high, xhigh, max).
The kyosei skill itself only dispatches reviewer subagents and posts JSON,
so a lower level reduces cost and latency without affecting review quality.
Reviewer subagents declare their own effort in agent frontmatter,
which overrides this session-level value per Claude Code's agent fields spec.
Set to an empty string to omit the flag and use the model default.
type: string
required: false
default: "low"
allowed_tools:
description: >-
Allowed tools for Claude Code (newline-separated, replaces the default set below).
The default allows `Bash` without any command restriction and `Write`,
because the kyosei plugin runs its own bundled binaries
whose names and paths differ per release,
reviewers write intermediate results to scratch files,
and `node` alone already permits arbitrary code execution anyway.
Reviewer subagents restrict their own tools in agent frontmatter,
but that is not a boundary because general-purpose subagents
inherit the tools of the session that started them.
The disposable runner only protects the working tree:
the session can read the credentials in the process environment
and has ways to send them elsewhere.
Since the pull request text it reads is attacker controlled,
replace this default with a stricter policy
when you review untrusted input such as fork pull requests.
See the README for details.
List each GitHub MCP tool individually as `mcp__github__<tool_name>`,
because claude-code-action only starts the GitHub MCP server
when a tool name begins with `mcp__github__`
(the bare `mcp__github` prefix does not work).
The default also allows what the bundled plugins need:
the `Agent` tool and the MCP servers used by the research survey agent
(`mcp__backlog__*`, `mcp__plugin_nix-tasuke_nixos`, `mcp__plugin_research_*`).
The `mcp__plugin_*` servers ship with the bundled plugins and work out of the box.
Backlog (`mcp__backlog__*`) is not bundled, so it only works
if you configure the Backlog MCP server yourself (for example via `.mcp.json`).
type: string
required: false
default: |
Agent
Bash
Glob
Grep
Read
Skill
Task
TodoWrite
WebFetch
WebSearch
Write
mcp__backlog__get_issue
mcp__backlog__get_issue_comments
mcp__backlog__get_issues
mcp__backlog__get_myself
mcp__backlog__get_notifications
mcp__backlog__get_project
mcp__backlog__get_project_list
mcp__backlog__get_pull_request
mcp__backlog__get_pull_requests
mcp__backlog__get_wiki
mcp__backlog__get_wiki_pages
mcp__github__get_code_scanning_alert
mcp__github__get_commit
mcp__github__get_dependabot_alert
mcp__github__get_discussion
mcp__github__get_discussion_comments
mcp__github__get_file_contents
mcp__github__get_issue
mcp__github__get_issue_comments
mcp__github__get_job_logs
mcp__github__get_label
mcp__github__get_latest_release
mcp__github__get_me
mcp__github__get_pull_request
mcp__github__get_pull_request_diff
mcp__github__get_pull_request_files
mcp__github__get_pull_request_review_comments
mcp__github__get_pull_request_reviews
mcp__github__get_pull_request_status
mcp__github__get_release_by_tag
mcp__github__get_secret_scanning_alert
mcp__github__get_tag
mcp__github__get_team_members
mcp__github__get_teams
mcp__github__get_workflow_run
mcp__github__issue_read
mcp__github__list_branches
mcp__github__list_code_scanning_alerts
mcp__github__list_commits
mcp__github__list_dependabot_alerts
mcp__github__list_discussion_categories
mcp__github__list_discussions
mcp__github__list_issue_types
mcp__github__list_issues
mcp__github__list_pull_requests
mcp__github__list_releases
mcp__github__list_secret_scanning_alerts
mcp__github__list_sub_issues
mcp__github__list_tags
mcp__github__list_workflow_jobs
mcp__github__list_workflow_runs
mcp__github__list_workflows
mcp__github__pull_request_read
mcp__github__search_code
mcp__github__search_issues
mcp__github__search_pull_requests
mcp__github__search_repositories
mcp__github__search_users
mcp__plugin_nix-tasuke_nixos
mcp__plugin_research_cloudflare
mcp__plugin_research_context7
mcp__plugin_research_deepwiki
mcp__plugin_research_mdn
mcp__plugin_research_microsoft-learn
additional_allowed_tools:
description: Additional allowed tools to append to allowed_tools (newline-separated)
type: string
required: false
default: ""
additional_directories:
description: >-
Extra directories Claude may read and write outside the workspace
(newline-separated absolute paths).
These are appended to the built-in ones,
which are `$RUNNER_TEMP`, `$XDG_RUNTIME_DIR` and `$TMPDIR` (or `/tmp`)
when they exist and are writable.
The kyosei skill writes review information files under those directories,
and Claude Code puts its own scratch files there,
so tools would otherwise be denied for being outside the workspace.
The action merges this list into the settings it passes to claude-code-action
as `permissions.additionalDirectories`,
together with whatever the `settings` input already contains.
type: string
required: false
default: ""
claude_args:
description: >-
Additional arguments to pass to Claude CLI
(appended after --model and --allowed-tools)
type: string
required: false
default: ""
# UI control
include_fix_links:
description: Include 'Fix this' deep links in PR review feedback
type: boolean
required: false
default: true
display_report:
description: >-
Display Claude Code Report in GitHub Step Summary.
Useful for understanding what Claude did during the review.
"auto" (default) enables it only for private repositories.
"always" enables it regardless of repository visibility.
"never" disables it entirely.
"true"/"false" are accepted as aliases for backward compatibility.
type: string
required: false
default: "auto"
show_full_output:
description: >-
Show full Claude Code JSON output in Actions logs.
May contain secrets in tool results; use only for debugging.
Ignored on public repositories to prevent secret leakage.
type: boolean
required: false
default: false
# Marketplace and plugin
marketplace_url:
description: Git URL of the plugin marketplace
type: string
required: false
default: "https://github.com/ncaq/konoka.git"
plugin_name:
description: Plugin identifier within the marketplace (newline-separated for multiple)
type: string
required: false
default: |-
kyosei@konoka
nix-tasuke@konoka
research@konoka
# Self-hosted runner support
self_hosted_packages:
description: >-
Newline-separated list of packages to install via apt-get on self-hosted runners.
Installation runs only when the runner is self-hosted and apt-get is available.
Set to an empty string to skip installation entirely.
type: string
required: false
default: |
curl
gawk
gh
git
jq
zstd
# Workflow configuration
runs-on:
description: >-
Runner label(s) for the job.
A single label can be written as a plain string
(e.g. ubuntu-24.04)
or a JSON string
(e.g. "ubuntu-24.04").
Multiple labels require a JSON array
(e.g. ["self-hosted", "linux"]).
An object with group/labels keys
(e.g. {"group":"my-group","labels":["x64"]})
is also accepted.
type: string
required: false
default: ubuntu-24.04
timeout-minutes:
description: Job timeout in minutes. Set as a safeguard against hangs.
type: number
required: false
default: 60
fetch-depth:
description: >-
Number of commits to fetch.
Fetches some history so git log can provide past context for reviews.
type: number
required: false
default: 50
permissions: {}
# Cancel previous runs on the same PR to avoid stale reviews.
# The review agent reads the current PR state, so concurrent runs
# on different revisions would produce inconsistent results.
concurrency:
group: kyosei-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
kyosei:
name: review
# Normalize runs-on input for `fromJSON()`:
# - JSON-quoted string (starts with `"`): pass through
# - JSON array (starts with `[`): pass through
# - JSON object (starts with `{`): pass through
# - Plain string: wrap in JSON quotes via `format()`
runs-on: ${{
fromJSON(startsWith(inputs['runs-on'], '"') &&
inputs['runs-on'] ||
startsWith(inputs['runs-on'], '[') &&
inputs['runs-on'] ||
startsWith(inputs['runs-on'], '{') &&
inputs['runs-on'] ||
format('"{0}"', inputs['runs-on']))
}}
# Claude GitHub App manages its own token, so only minimal permissions are needed.
# If the caller passes `custom_github_token` explicitly, additional permissions
# (e.g. `pull-requests: write`)
# must be granted by the caller.
permissions:
contents: read # Read repository contents for checkout
id-token: write # Required for Claude Code Action OIDC authentication
timeout-minutes: ${{ inputs['timeout-minutes'] }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
persist-credentials: false
fetch-depth: ${{ inputs['fetch-depth'] }}
- uses: ncaq/kyosei-action@v2.4.0 # zizmor: ignore[unpinned-uses] self-reference
with:
claude_code_oauth_token: ${{ secrets.claude_code_oauth_token }}
anthropic_api_key: ${{ secrets.anthropic_api_key }}
use_bedrock: ${{ inputs.use_bedrock && 'true' || 'false' }}
use_vertex: ${{ inputs.use_vertex && 'true' || 'false' }}
use_foundry: ${{ inputs.use_foundry && 'true' || 'false' }}
custom_github_token: ${{ secrets.custom_github_token }}
allowed_bots: ${{ inputs.allowed_bots }}
allowed_non_write_users: ${{ inputs.allowed_non_write_users }}
include_comments_by_actor: ${{ inputs.include_comments_by_actor }}
exclude_comments_by_actor: ${{ inputs.exclude_comments_by_actor }}
additional_permissions: ${{ inputs.additional_permissions }}
settings: ${{ inputs.settings }}
model: ${{ inputs.model }}
effort: ${{ inputs.effort }}
allowed_tools: ${{ inputs.allowed_tools }}
additional_allowed_tools: ${{ inputs.additional_allowed_tools }}
additional_directories: ${{ inputs.additional_directories }}
claude_args: ${{ inputs.claude_args }}
include_fix_links: ${{ inputs.include_fix_links && 'true' || 'false' }}
display_report: ${{ inputs.display_report }}
show_full_output: ${{ inputs.show_full_output && 'true' || 'false' }}
marketplace_url: ${{ inputs.marketplace_url }}
plugin_name: ${{ inputs.plugin_name }}
self_hosted_packages: ${{ inputs.self_hosted_packages }}