Skip to content

Migrate claude.yml to the Morrison-Lab/gha reusable agent workflow - #183

Merged
d-morrison merged 2 commits into
mainfrom
claude/issue-182-migrate-agent-workflow
Aug 4, 2026
Merged

Migrate claude.yml to the Morrison-Lab/gha reusable agent workflow#183
d-morrison merged 2 commits into
mainfrom
claude/issue-182-migrate-agent-workflow

Conversation

@d-morrison

@d-morrison d-morrison commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Closes #182. The second half of #178 (review-workflow half landed in #181).

Replaces rpt's bespoke anthropics/claude-code-action@v1 @claude agent workflow with a thin caller of Morrison-Lab/gha/.github/workflows/claude.yml@v2. rpt's @claude agent now inherits upstream hardening as @v2 slides: the bot-actor self-trigger guard, late-comment polling, reviewer re-request + review re-dispatch on push, the cost comment, and push-failure reporting. Matches serodynamics / ai-config.

Important

Deliberate behavior changes — please confirm at review:

1. Permission escalation (read → write), because the reusable agent needs write to do its job:

scope change why
contents read → write push branches, open PRs (was comment-only)
issues read → write post issue/PR comments (ack + response)
actions read → write dispatch the review workflow (gh workflow run)
id-token write unchanged
pull-requests write unchanged

The headline change is that @claude goes from advisory-only (couldn't push) to a write-capable implementer. Veto if you'd rather keep it advisory on the template.

2. Adds a trusted-author gate (OWNER/MEMBER/COLLABORATOR). The current workflow gates only on the @claude mention with no author check, so any commenter can invoke it. The gate is what makes the write escalations safe — the two are coupled.

3. Effective timeout 50 → 60 min. A uses: reusable-workflow-call job can't set timeout-minutes at the caller, so it inherits the reusable's timeout-minutes: 60. This exceeds copilot-instructions.md's 50-min cap — a gap #181 already introduced for claude-code-review.yml. This PR adds a reusable-workflow-call exception to that rule so the repo's own instructions stay consistent with the two migrated workflows.

Reviewer toggling (the issue's Gap 2, for claude.yml)

Bespoke: removes d-morrison while Claude works, re-adds after. Reusable: re-requests the reviewer (default d-morrison) when Claude pushes commits, and dispatches a fresh review. Not identical, but the closest thin-caller equivalent. (rme kept its bespoke claude.yml; this migrates it per your "do it".)

Feature diff (bespoke → reusable)

Bespoke behavior Reusable equivalent
4 triggers (issue_comment, PR review comment, issues opened/assigned, PR review) preserved
@claude mention gate, no author check @claude + trusted-author gate
contents: read (comment-only) contents/issues/actions: write (implementer)
remove/re-add d-morrison reviewer reviewer: d-morrison re-request on push
no R / Quarto setup setup-r (default true) + install-quarto: true
timeout-minutes: 50 on the job inherits reusable's 60 (see box; doc exception added)
bare agent, no pre-commit guidance R-package pre-commit checklist via prompt-addendum

Input choices

  • install-quarto: true — rpt uses Quarto (VignetteBuilder: quarto, Config/Needs/website: quarto).
  • setup-r (default true) / use-renv (default false) — rpt CI restores deps from DESCRIPTION via setup-r-dependencies, not the renv.lock.
  • reviewer: d-morrison (default), use-ai-config (default true).

Review

Round 1 (claude-review) returned Needs more work with two documentation findings (undisclosed issues/actions escalation; the 50→60 timeout). Both addressed in 092a664 — the permission set and timeout are now fully enumerated above and in the file header, and the timeout-rule exception was added to copilot-instructions.md.

🤖 Generated with Claude Code

…loses #182)

Replace the bespoke anthropics/claude-code-action@v1 @claude agent workflow
with a thin caller of Morrison-Lab/gha/.github/workflows/claude.yml@v2, so rpt
inherits upstream hardening as @v2 slides (bot-actor self-trigger guard, late
comment polling, reviewer re-request + review re-dispatch on push, cost
comment, push-failure reporting). The second half of #178 (whose review-
workflow half landed in #181).

Two deliberate behavior changes (see #182):
- contents: read -> write: the agent can now push branches and open PRs
  (the bespoke agent was comment-only).
- Adds a trusted-author gate (OWNER/MEMBER/COLLABORATOR): the bespoke
  workflow gated only on the @claude mention with no author check, so the
  gate is what makes the contents: write upgrade safe. The two are coupled.

The bespoke reviewer stash-while-working / re-add-after is replaced by the
reusable's reviewer input (re-request d-morrison when Claude pushes commits).

Inputs: install-quarto (rpt uses Quarto for vignettes/website); setup-r and
use-renv left at defaults (true/false) since rpt CI restores deps from
DESCRIPTION via setup-r-dependencies, not renv. rpt's R-package pre-commit
checklist rides along via prompt-addendum.
Copilot AI review requested due to automatic review settings August 4, 2026 01:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@d-morrison
d-morrison requested a review from Copilot August 4, 2026 01:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread .github/workflows/claude.yml
Comment thread .github/workflows/claude.yml
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…le-call timeout exception

Review of #183 (claude-review, Needs more work) raised two documentation
findings; both addressed:

1. The header comment and PR body flagged only contents: read->write, but the
   diff also escalates issues: read->write and actions: read->write. The header
   now enumerates all four permission changes with each one's reason.

2. A uses: reusable-workflow-call job cannot set timeout-minutes, so this job
   inherits the reusable's timeout-minutes: 60, exceeding copilot-instructions.md's
   50-minute cap. #181 already merged the same structural gap, so main's own
   instructions were already contradicted. Add a reusable-call exception to that
   rule and disclose the 50->60 change in the header.

No functional change to the workflow (claude.yml edits are comment-only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 4, 2026 02:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Morrison-Lab.github.io/rpt/pr-preview/pr-183/

Built to branch gh-pages at 2026-08-04 02:11 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Comment thread .github/copilot-instructions.md
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Claude finished reviewView run


This is a confirming review — no code has changed since the round 2 review (verdict: Needs more work). I verified:

  • Diff unchanged: still only two commits (720b330 PR-open commit, 092a664 review-fix commit) and the file content of .github/workflows/claude.yml / .github/copilot-instructions.md is byte-identical to what round 2 already reviewed — no new commits have landed.
  • Both original findings (permission-scope disclosure, 50→60 min timeout) remain resolved, as confirmed in round 2: the header comment on claude.yml enumerates all four permission scopes and the timeout trade-off, and copilot-instructions.md documents the uses:-reusable-workflow-call exception.
  • The round-2-introduced CI failures are now resolved. The two checks that were failing at the time of the round 2 review (Check Changelog Action, version-check) are now both SUCCESS (reruns at 2026-08-04T02:16–02:18Z). This wasn't via a new commit — the PR now carries the no version increment and no changelog labels, which is exactly the mechanism round 2's own finding suggested ("either bump the DESCRIPTION dev version ... or apply the no version increment label"). All other checks (R-CMD-check across all platforms/OSes, lint, spellcheck, docs, test-coverage, check-readme) are green.

No new issues found in this pass — the diff content was already fully verified against the reusable workflow's real workflow_call schema in round 1/2, and nothing in it has changed.

Verdict

Ready for merge — the round-2 verdict's outstanding item (failing Check Changelog Action / version-check) is now resolved via the no version increment / no changelog labels, and both prior inline findings remain addressed with no new issues introduced.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.5265 (review) — run

@d-morrison
d-morrison merged commit 2f78897 into main Aug 4, 2026
45 of 47 checks passed
@d-morrison
d-morrison deleted the claude/issue-182-migrate-agent-workflow branch August 4, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate claude.yml agent workflow to the Morrison-Lab/gha reusable workflow

2 participants