CI: migrate Claude workflows to central d-morrison/gha reusable workflows - #31
Conversation
…lows Replace the inline anthropics/claude-code-action@v1 definitions in claude.yml and claude-code-review.yml with thin callers of the central d-morrison/gha reusable workflows (@v1), continuing the consolidation that already moved check-links and summary in #29. - claude.yml now calls gha's reusable claude.yml in agent mode. The caller grants write permissions and `secrets: inherit` so Claude can push branches and open PRs. Configured for a Quarto book: setup-r: false (no R package code), install-quarto: true. - claude-code-review.yml now calls gha's reusable claude-code-review.yml and adds the workflow_dispatch path (pr_number) so claude.yml can re-dispatch a review after an @claude run pushes commits. - Both pass a Quarto/SERG-lab-manual prompt-addendum tailored to this book. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BvMsJLFGjYAaXa2pacjubC
main advanced with the qwt-template conversion (#28), which pulled the full inline claude.yml / claude-code-review.yml workflows from the template. PR #31 migrates those same files to thin callers of the central d-morrison/gha @v1 reusable workflows. Conflict resolution keeps the PR's thin-caller versions: the reusable claude.yml@v1 (823 lines) and claude-code-review.yml@v1 are supersets of all the inline logic main carried (late-comment polling, dedup, issue-branch setup, self-mod skip), and they expose exactly the inputs the callers pass (setup-r, install-quarto, prompt-addendum, pr-number). Migrating therefore loses no behavior while removing the duplicated inline blocks. Carried main's orthogonal on:-block refinement into the thin caller: drop the `issues: assigned` trigger (the trusted-author gate keys on the issue author, not the assigner, so `assigned` can't usefully grant access). The caller-level concurrency block is intentionally omitted — the reusable workflows define their own job-level concurrency, matching the house thin-caller pattern from #29 (check-links.yml, summary.yml). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TqzTSVzUdxymZnu4go9hFf
Manual review — clean ✅The automated
This is expected for a workflow-migration PR; the reviewer runs normally on every PR after this merges. In the meantime, here's a manual review of the diff. Findings
Verdict: zero findings. CI is fully green (8/8 checks). Clean. Manual review by the Claude Code CLI (the in-workflow reviewer can't self-review this PR; runs automatically post-merge). Generated by Claude Code |
|
👀 Picked up by workflow run #27863167165. R/Quarto setup runs first; Claude itself responds after that. |
|
|
The PR is already merged. The triggering comment is a manual code review posted by There are no subsequent non-bot My response: Thanks for the manual review and the clear write-up on why the automated reviewer was skipped. The explanation is exactly right — GitHub prevents the code-review action from running when the PR modifies the very workflow file that drives it, since it must match the default branch version. Now that this is merged, the automated The rationale you captured (trusted-author gate, — posted by @claude post-step from workflow run |
Summary
Continues the CI consolidation started in #29 (which moved
check-linksandsummaryto the centrald-morrison/ghareusable workflows) by migrating the two remaining workflows that have a gha equivalent: the Claude bot and the Claude code reviewer.Both files become thin callers of the
@v1reusable workflows instead of carrying their own inlineanthropics/claude-code-action@v1step blocks.Changes
.github/workflows/claude.yml→d-morrison/gha/.github/workflows/claude.yml@v1contents/pull-requests/issues/actions: write+id-token: writeand usessecrets: inheritso Claude can push branches and open/update PRs in response to@claudementions.setup-r: false(this repo has no R package code — noR/, no executable.qmdchunks) andinstall-quarto: trueso Claude canquarto renderto verify changes.if:@claudemention gate is preserved; the reusable workflow additionally enforces the trusted-author (OWNER/MEMBER/COLLABORATOR) gate..github/workflows/claude-code-review.yml→d-morrison/gha/.github/workflows/claude-code-review.yml@v1workflow_dispatch(pr_number) path soclaude.ymlcan re-dispatch a review after an@clauderun pushes commits. Permissions bumped topull-requests/issues: writeso the reviewer can post inline review comments.Both pass a short
prompt-addendumtailored to a Quarto book and the SERG lab manual's.qmdconventions.Behavior change to note for review
The previous
claude.yml/claude-code-review.ymlran with read-only tokens. Migrating to the gha reusable workflows grants Claude write access (push branches, open PRs, post review comments) — this is the standard gha consumer pattern and the purpose of the reusable agent workflow. TheCLAUDE_CODE_OAUTH_TOKENsecret already exists (the prior workflows used it), andsecrets: inheritpasses it through.Left unchanged (intentionally)
check-links.yml,summary.yml— already migrated in CI: adopt central d-morrison/gha reusable workflows (links + summary) #29.check-spelling.yaml,lint-project.yaml,preview.yml,publish.yml,copilot-setup-steps.yml— no gha equivalent exists yet.check-bibliography-dois.yml— left disabled as-is (it was commented out because DOI services return 403s to automated access). gha does ship an equivalent (check-bibliography-dois.yml@v1, withno-metadata-check/exclude-keysinputs) if you want to revisit re-enabling it, but I did not re-enable it here without a decision from you.🤖 Generated with Claude Code
https://claude.ai/code/session_01BvMsJLFGjYAaXa2pacjubC
Generated by Claude Code