Skip to content

CI: migrate Claude workflows to central d-morrison/gha reusable workflows - #31

Merged
d-morrison merged 2 commits into
mainfrom
claude/brave-dirac-1zad5s
Jun 20, 2026
Merged

CI: migrate Claude workflows to central d-morrison/gha reusable workflows#31
d-morrison merged 2 commits into
mainfrom
claude/brave-dirac-1zad5s

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Summary

Continues the CI consolidation started in #29 (which moved check-links and summary to the central d-morrison/gha reusable 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 @v1 reusable workflows instead of carrying their own inline anthropics/claude-code-action@v1 step blocks.

Changes

.github/workflows/claude.ymld-morrison/gha/.github/workflows/claude.yml@v1

  • Runs in agent mode (the only mode the reusable workflow offers): the caller grants contents/pull-requests/issues/actions: write + id-token: write and uses secrets: inherit so Claude can push branches and open/update PRs in response to @claude mentions.
  • Quarto-book configuration: setup-r: false (this repo has no R package code — no R/, no executable .qmd chunks) and install-quarto: true so Claude can quarto render to verify changes.
  • The caller-side if: @claude mention gate is preserved; the reusable workflow additionally enforces the trusted-author (OWNER/MEMBER/COLLABORATOR) gate.

.github/workflows/claude-code-review.ymld-morrison/gha/.github/workflows/claude-code-review.yml@v1

  • Adds the workflow_dispatch (pr_number) path so claude.yml can re-dispatch a review after an @claude run pushes commits. Permissions bumped to pull-requests/issues: write so the reviewer can post inline review comments.

Both pass a short prompt-addendum tailored to a Quarto book and the SERG lab manual's .qmd conventions.

Behavior change to note for review

The previous claude.yml/claude-code-review.yml ran 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. The CLAUDE_CODE_OAUTH_TOKEN secret already exists (the prior workflows used it), and secrets: inherit passes 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, with no-metadata-check/exclude-keys inputs) 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

…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

Copy link
Copy Markdown
Collaborator Author

Manual review — clean ✅

The automated @claude reviewer skipped this PR (and structurally will until merge), because PR #31 edits .github/workflows/claude-code-review.yml itself. GitHub's code-review action refuses to run when the review workflow on the PR differs from the default branch — the run log shows:

Skipping action due to workflow validation: Workflow validation failed. The workflow file must … have identical content to the version on the repository's default branch … this is normal and you should ignore this error.

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

.github/workflows/claude.yml — thin caller of d-morrison/gha/.github/workflows/claude.yml@v1

  • Fully delegates to the reusable workflow; no duplicated inline logic. ✔ modular
  • Caller permissions (contents/pull-requests/issues/actions/id-token) match what the reusable agent workflow needs.
  • setup-r: false + install-quarto: true are correct for a prose Quarto site with no R package code.
  • if: gate is the caller-side @claude-mention check; the reusable workflow enforces the trusted-author gate (documented in the header).
  • Carries over main's refinement from the qwt conversion: dropping the issues: assigned trigger (the trusted-author gate keys on the issue author, not the assigner).

.github/workflows/claude-code-review.yml — thin caller of …/claude-code-review.yml@v1

  • workflow_dispatch.pr_number typed string to match the reusable pr-number input. ✔
  • Reviewer permissions correct (pull-requests/issues: write for inline comments, contents: read, id-token: write).
  • Matches the thin-caller house pattern established in CI: adopt central d-morrison/gha reusable workflows (links + summary) #29 (check-links.yml, summary.yml); caller-level concurrency intentionally omitted since the reusable workflow defines its own.

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

@d-morrison
d-morrison merged commit c469239 into main Jun 20, 2026
8 checks passed
@d-morrison
d-morrison deleted the claude/brave-dirac-1zad5s branch June 20, 2026 06:40
@github-actions

Copy link
Copy Markdown

👀 Picked up by workflow run #27863167165. R/Quarto setup runs first; Claude itself responds after that.

@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-20 06:42 UTC

@github-actions

Copy link
Copy Markdown

The PR is already merged. The triggering comment is a manual code review posted by d-morrison (the owner), explaining why the automated @claude reviewer couldn't run on this PR (since the PR itself edits the review workflow). No action items were raised — the comment documents zero findings and a clean CI run.

There are no subsequent non-bot @claude comments to address.

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 @claude reviewer will run normally on all subsequent PRs.

The rationale you captured (trusted-author gate, setup-r: false/install-quarto: true for a prose Quarto site, caller-side @claude gate vs. reusable-workflow enforcement) is useful context for anyone auditing the CI setup later. Agreed on zero findings.

— posted by @claude post-step from workflow run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants