-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (91 loc) · 4.46 KB
/
Copy pathclaude-code-review.yml
File metadata and controls
104 lines (91 loc) · 4.46 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
# Automatic Claude Code review of pull requests.
#
# Runs the upstream `code-review@claude-code-plugins` plugin so we pick up
# any improvements to the canonical review skill, then layers a
# Quarto/R-specific addendum on top so the reviewer also catches issues
# particular to this manuscript template repo.
#
# Each run posts a fresh review comment; prior reviews are left in place
# so the PR keeps a visible history rather than a rolling sticky.
#
# Skips drafts, Dependabot bumps, and fork PRs (fork PRs can't read repo
# secrets). Project guidance is in CLAUDE.md. Requires the
# CLAUDE_CODE_OAUTH_TOKEN repository secret.
name: Claude Code Review
on:
pull_request:
types: [opened, synchronize, ready_for_review, reopened]
workflow_dispatch:
inputs:
pr_number:
description: 'Pull request number to review'
required: true
type: number
concurrency:
group: claude-review-${{ github.event.pull_request.number || inputs.pr_number }}
cancel-in-progress: true
jobs:
claude-review:
if: |
github.event_name == 'workflow_dispatch' ||
(github.event.pull_request.draft == false &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: ubuntu-latest
env:
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
permissions:
contents: read
pull-requests: write
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive
- name: Claude PR review
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
allowed_bots: "github-actions[bot]"
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
plugins: 'code-review@claude-code-plugins'
track_progress: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}
prompt: |
/code-review:code-review ${{ github.repository }}/pull/${{ env.PR_NUMBER }}
In addition to the standard checks above, this is the qmt Quarto
manuscript template — prose-heavy, multi-format, and re-used as a
template for downstream manuscripts — so also prioritize:
1. **Quarto / prose correctness**
- `.qmd` syntax: chunk options use `#|` directives, fenced
blocks are balanced, cross-refs (`@fig-`, `@tbl-`, `@sec-`)
resolve to defined labels.
- Author YAML: name, ORCID, affiliations, and `corresponding`
fields are well-formed.
- Supplementary notebooks listed in `_quarto.yml` under
`manuscript: notebooks:` exist and have matching labels.
- Bullet-list rule: 3+ items use bullets with a blank line above.
- `code-fold: true` is used on chunks where the output (not the
code) is the point, and avoided on analysis-narrative code.
2. **R code**
- Conforms to `.lintr.R` settings (snake_case, line length, etc.).
- No new package dependencies without justification — every
dependency added here lands in every downstream manuscript.
3. **Build hygiene**
- No accidental commits of `_manuscript/`, `_freeze/`, or `.quarto/`.
- `README.md` is generated; edits should go to `README.Rmd`.
- Bibliography entries in `references.bib` are well-formed BibTeX
with DOIs for articles and books.
4. **CI / template impact**
- Workflow changes don't break the `copilot-setup-steps.yml`
contract or the publish/preview pipelines.
- Spell-check / link-check failures are fixed at the source
(wordlist or content) rather than suppressed.
**Post line-specific findings as inline review comments** anchored
to the relevant line(s). Reserve the top-level summary for a brief
overall verdict plus any finding not tied to a specific line.
Skip generic praise — be concrete. If the PR looks clean, say so briefly.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh pr comment create:*)"