Skip to content

Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters #51

Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters

Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters #51

Workflow file for this run

# Caller stub for d-morrison/gha's reusable @claude agent workflow
# (replaces the stock anthropics/claude-code-action template; see
# ucdavis/win#74). Secrets are passed explicitly rather than via
# `secrets: inherit`: GitHub only inherits secrets into a reusable workflow
# owned by the same org/user, so this ucdavis-org repo calling the
# d-morrison-owned workflow would inherit an empty token.
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
# Cheap caller-side gate: only invoke the reusable workflow when an @claude
# mention is present AND the author is trusted. The reusable workflow
# enforces the same trusted-author gate (OWNER/MEMBER/COLLABORATOR); the
# caller-side copy stops untrusted mentions from spawning runs at all
# (saves runner minutes, and keeps secrets out of the picture if the
# reusable workflow's gate ever regresses) — see d-morrison/gha#259.
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.review.author_association)) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.issue.author_association))
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: write # dispatch the review workflow via `gh workflow run`
uses: d-morrison/gha/.github/workflows/claude.yml@v2
secrets:
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} # Max-plan OAuth; empty when using API key
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} # direct API key; empty when using OAuth
SUBMODULES_TOKEN: ${{ secrets.SUBMODULES_TOKEN }} # optional; empty when unset
WORKFLOW_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} # optional; for editing .github/workflows
with:
install-quarto: true
use-renv: true
checkout-submodules: true
reviewer: d-morrison
apt-packages: >-
libnode-dev libglpk-dev libcurl4-openssl-dev libssl-dev libxml2-dev
libgit2-dev libfontconfig1-dev libfreetype6-dev libharfbuzz-dev
libfribidi-dev libpng-dev libtiff5-dev libjpeg-dev
prompt-addendum: |
This is the win (What If? lecture notes) Quarto website, an R
project using renv. Before committing, run
spelling::spell_check_package() (wordlist: inst/WORDLIST, keep it
case-insensitively sorted) and lintr::lint_dir() on changed files
(.lintr.R config). LaTeX notation uses the latex-macros submodule's
macros (e.g. \E{...}, \hE{...}, \ind) rather than raw equivalents.