Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
fbf70f7
feat: request a Claude review when a team member's pull request is ready
claude Nov 18, 2026
4ac454a
feat: add the example caller workflow and lint it in checks
claude Nov 18, 2026
91e2b39
docs: explain the Claude review workflow and the request decision
claude Nov 18, 2026
bd47ec8
fix: name the kind of review request in the request body
claude Nov 18, 2026
4750a5b
fix: harden the decide job's outputs, lookup names and final step
claude Nov 18, 2026
e6ea345
docs: list decision-failed and say how the decide job fails
claude Nov 18, 2026
ff45f05
test: cover three untested paths of the request decision
claude Nov 18, 2026
f9079f7
fix: skip a pull request payload that has no author
claude Nov 18, 2026
27aea00
fix: declare and assign the output delimiter separately
claude Nov 18, 2026
80ed397
refactor: move the membership lookup to Python so every answer is tested
claude Nov 18, 2026
e8af59f
refactor: move the decision fallback step to Python so it cannot fail
claude Nov 18, 2026
b090948
test: let the stub server answer POST requests and record their bodies
claude Nov 18, 2026
d283f2e
refactor: move the routine call to Python so every answer is tested
claude Nov 18, 2026
88fe099
ci: run the unit tests on Python 3.10 too
claude Nov 18, 2026
a1a4225
fix: bound the membership lookup in time and size, and tighten the st…
claude Nov 18, 2026
0309405
fix: count an accepted routine request as sent however its body arrives
claude Nov 18, 2026
c636b5b
Merge branch 'ci/checks' into feat/ready-review-requests
claude Nov 18, 2026
8024083
refactor: run the request decision from its own file, checked out at …
claude Nov 18, 2026
95e1baf
Merge branch 'origin/feat/ready-review-requests' into feat/ready-revi…
claude Nov 18, 2026
339a007
ci: show each actionlint error as an annotation on the check run
claude Nov 18, 2026
270e2d4
Revert "ci: show each actionlint error as an annotation on the check …
claude Nov 18, 2026
b0afe73
test: tie the workflow's decision path to the real file, and name the…
claude Nov 18, 2026
b7a347e
docs: say the Python steps are inline for now, and that this reposito…
claude Nov 18, 2026
98e11f9
refactor: run the membership lookup and the report from files with on…
claude Nov 18, 2026
77e125d
ci: audit the workflows and example callers with zizmor
claude Nov 18, 2026
5d7626c
ci: check the workflow lockfile and let Dependabot update actions
claude Nov 18, 2026
fbd4ee4
docs: describe the zizmor, lockfile and Dependabot checks
claude Nov 18, 2026
e34d171
fix: leave the decision-failed skip when the report file cannot run
claude Nov 18, 2026
215ea00
test: run the lookup step as written, test redacted, and guard steps/…
claude Nov 18, 2026
e359c29
refactor: run the routine call from steps/fire.py, checked out by the…
claude Nov 18, 2026
8b59d3b
Merge remote-tracking branch 'origin/feat/ready-review-requests' into…
claude Nov 18, 2026
fba8e20
fix: fail the lockfile check when a pull request deletes the lockfile
claude Nov 18, 2026
c751d56
ci: lint and type-check the Python, and run the tests on 3.10, 3.12 a…
claude Nov 18, 2026
fe24e19
Merge origin/feat/ready-review-requests into feat/ready-review-requests
claude Nov 18, 2026
9554bde
ci: let actionlint accept job.workflow_repository and job.workflow_sha
claude Nov 18, 2026
f4304eb
fix: report one error when the fire step's files are not all checked out
claude Nov 18, 2026
024b438
Merge origin/feat/ready-review-requests into fix24-local
claude Nov 18, 2026
3345638
refactor(steps): type the step files and settle Ruff's findings
claude Nov 18, 2026
e4e2149
test: settle Ruff's and mypy's findings in the tests
claude Nov 18, 2026
5e2e459
docs: describe the Ruff and mypy check and the tests on three Pythons
claude Nov 18, 2026
d0c6acf
Merge origin/feat/ready-review-requests into feat/ready-review-requests
claude Nov 18, 2026
214d428
style(test): wrap two long lines in the fire step's tests
claude Nov 18, 2026
71342dd
test: require every step file in the fully typed mypy override
claude Nov 18, 2026
5547c62
style(test): avoid assert in the mypy override test
claude Nov 18, 2026
dc71ef0
refactor: send every step's request through one helper
claude Nov 18, 2026
cd2da0e
refactor: print the report step's errors with the shared helper
claude Nov 18, 2026
bc01862
refactor: name the checkout directory once per job
claude Nov 18, 2026
90463ea
refactor: write needs-lookup straight from jq
claude Nov 18, 2026
5894330
perf(test): run each workflow query once, and poll the stub server fa…
claude Nov 18, 2026
538dbc8
test: drop the harness's support for inline Python steps
claude Nov 18, 2026
2aee1c2
test: share the step-file copy and step-field lookups
claude Nov 18, 2026
1d550cd
test: drop the checkout checks that StepFilesTest already makes for e…
claude Nov 18, 2026
da35e47
refactor: run each saved case with one jq
claude Nov 18, 2026
fcf491e
ci: run the saved cases in one tests job, not three
claude Nov 18, 2026
26be90d
fix: say the outcome is unknown when the routine call times out or drops
claude Nov 18, 2026
4a62214
docs: explain that a third fire request replaces the waiting one
claude Nov 18, 2026
99bfbbd
fix: put the lockfile in the job summary and keep the annotation short
claude Nov 18, 2026
d448427
refactor: make mypy strict by default instead of listing step files
claude Nov 18, 2026
8d6d526
refactor: flatten the HTTPError handling in send
claude Nov 18, 2026
2a56774
ci: cancel superseded checks runs on a pull request
claude Nov 18, 2026
30c0618
docs: re-pin the example caller to the last commit that changed a shi…
claude Nov 19, 2026
a8c443c
Merge main into feat/ready-review-requests
claude Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# actionlint configuration.
#
# GitHub added job.workflow_repository and job.workflow_sha on 3 September 2026.
# The newest actionlint, v1.7.12 (30 March 2026), does not know them yet and reports
# "property ... is not defined in object type". The shared review workflow uses them to
# check out this repository at the commit the caller pinned (see #20, #21 and #22).
#
# Only those two messages are ignored, and only in claude-review.yml. Every other check
# still runs on every file. Remove this file once an actionlint release knows the
# job.workflow_* properties, and bump the pin in checks.yml.
paths:
.github/workflows/claude-review.yml:
ignore:
- 'property "workflow_(repository|sha)" is not defined in object type'
26 changes: 26 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Keeps the actions this repository's workflows use, and the pinned Python tools, up to date. When Dependabot bumps an action's pin, it also
# regenerates that action's entry in the workflow lockfile, .github/workflows/actions.lock, in the same pull request.
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
# Waits 7 days after a release before proposing it, so a bad or compromised release has time to be found and
# pulled first. Only default-days applies to GitHub Actions. Security updates are not delayed.
cooldown:
default-days: 7
# The hashed requirements files for Ruff, mypy and zizmor. Whether Dependabot regenerates their --hash lines is not
# confirmed, so check each pull request's hashes (see the README).
- package-ecosystem: "pip"
directory: "/.github/python-checks"
schedule:
interval: "weekly"
cooldown:
default-days: 7
- package-ecosystem: "pip"
directory: "/.github/zizmor"
schedule:
interval: "weekly"
cooldown:
default-days: 7
363 changes: 363 additions & 0 deletions .github/python-checks/requirements.txt

Large diffs are not rendered by default.

114 changes: 114 additions & 0 deletions .github/scripts/check-lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#!/usr/bin/env bash
# Checks the workflow lockfile, .github/workflows/actions.lock, for the actions-lock job in
# .github/workflows/checks.yml. Run from the root of the repository, with `gh actions-lock` installed.
#
# - The lockfile is in the pull request: it fails unless `gh actions-lock --verify` passes and running
# `gh actions-lock` changes nothing, neither the lockfile nor the workflows.
# - The lockfile is missing, but the pull request's base branch has it: fails, so deleting the lockfile cannot pass.
# - Neither has it: only warns, so that the lockfile can be added later.
#
# Every outcome but a pass prints a short annotation, and writes what `gh actions-lock` made from the workflows (the
# lockfile and the changes to the workflows) to the job summary, so it can be reviewed and committed without installing
# the extension.
#
# Environment: BASE_REF is the pull request's base branch, empty outside a pull request. GH_TOKEN is the token for
# `gh actions-lock`, and for fetching the base branch. GITHUB_STEP_SUMMARY is the runner's job summary file; without
# it, only the annotation is printed.
set -uo pipefail

lockfile=.github/workflows/actions.lock
base_ref="${BASE_REF:-}"

# Output of `gh actions-lock` comes from the pull request's workflows and could print workflow commands, such as
# `::add-mask::`. The runner ignores workflow commands between these two lines, and only a command that carries this
# random token ends that.
token="$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n')"

# Runs a command with its output shielded, and keeps its exit status in $status.
shielded() {
echo "::stop-commands::$token"
"$@"
status=$?
echo "::$token::"
}

# Prints one short annotation of level $1 and title $2: $3. The annotation cannot carry the lockfile: GitHub limits an
# annotation's size, and the lockfile (as text and as base64) and the diff can pass it. What `gh actions-lock` made goes
# to the job summary, $GITHUB_STEP_SUMMARY, when the runner sets it, and the annotation points there.
report() {
printf '::%s file=%s,title=%s::%s' "$1" "$lockfile" "$2" "$3"
if [ -n "${GITHUB_STEP_SUMMARY:-}" ]; then
printf ' The lockfile it made, and the changes to the workflows, are in the job summary.'
write_summary "$2" >>"$GITHUB_STEP_SUMMARY"
fi
echo
}

# Prints, as Markdown for the job summary, the title $1 and what `gh actions-lock` made: the changed workflow files, the
# lockfile with its SHA-256 and base64, and the diff. Each goes in a fence that the text cannot end, a line of tildes
# longer than any a workflow would hold. The summary is not read as workflow commands.
write_summary() {
local fence=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf '## %s\n\nChanged workflow files:\n\n%s\n' "$1" "$fence"
git status --short -- .github/workflows
printf '%s\n' "$fence"
if [ -f "$lockfile" ]; then
printf '\nSHA-256 of the lockfile it made: `%s`\n\nBase64:\n\n%s\n%s\n%s\n' \
"$(sha256sum "$lockfile" | cut -d' ' -f1)" "$fence" "$(base64 --wrap=0 "$lockfile")" "$fence"
printf '\nThe lockfile:\n\n%s\n' "$fence"
cat "$lockfile"
printf '%s\n' "$fence"
fi
printf '\nChanges to the workflows:\n\n%s\n' "$fence"
git diff -- .github/workflows ':!.github/workflows/actions.lock'
printf '%s\n\n' "$fence"
}

# Whether the base branch has the lockfile. Deleting a committed lockfile is guarded for pull requests only: BASE_REF
# is empty on a push, so there is no base branch to compare with and base_has_lockfile stays false. On a push, a
# missing lockfile only warns. A base branch that cannot be fetched fails the check, because a missing
# lockfile could then pass unnoticed.
base_has_lockfile=false
if [ -n "$base_ref" ]; then
# The checkout does not keep the token, so it is given to this one fetch.
auth="$(printf 'x-access-token:%s' "${GH_TOKEN:-}" | base64 --wrap=0)"
if ! git -c "http.extraheader=AUTHORIZATION: basic $auth" fetch --quiet --no-tags --depth=1 origin \
"+refs/heads/$base_ref:refs/remotes/origin/$base_ref"; then
echo "::error file=$lockfile,title=Base branch not fetched::Could not fetch the base branch, so the check cannot tell whether it has $lockfile."
exit 1
fi
if git cat-file -e "origin/$base_ref:$lockfile" 2>/dev/null; then
base_has_lockfile=true
fi
fi

# Runs `gh actions-lock` once, to make the lockfile and rewrite the workflows as it would, for the annotation.
make_lock() {
shielded gh actions-lock --no-interactive
lock_status=$status
if [ "$lock_status" -ne 0 ]; then
echo "::error title=gh actions-lock failed::gh actions-lock itself failed (exit status $lock_status); this is not a finding about the workflows. See the log."
fi
}

if [ ! -f "$lockfile" ]; then
make_lock
if [ "$base_has_lockfile" = true ]; then
report error "Workflow lockfile deleted" \
"$lockfile is on the base branch $base_ref but is missing here. Restore it, or run gh actions-lock. gh actions-lock made these changes:"
exit 1
fi
report warning "No workflow lockfile yet" \
"Not checked: $lockfile is not committed. gh actions-lock would make these changes:"
exit 0
fi

shielded gh actions-lock --verify
verify_status=$status
make_lock
if [ "$verify_status" -eq 0 ] && [ "$lock_status" -eq 0 ] && git diff --quiet -- .github/workflows; then
exit 0
fi
report error "Workflow lockfile out of date" \
"Run gh actions-lock and commit the result. gh actions-lock made these changes:"
exit 1
153 changes: 147 additions & 6 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Checks every pull request to this repository, and every push to main: lints the workflows, checks the request
# decision's test script, and runs the request decision's saved cases.
# Checks every pull request to this repository, and every push to main: lints and audits the workflows and the example
# callers, checks the workflow lockfile, lints and type-checks the Python, runs the request decision's saved cases, and
# runs the unit tests of the reusable workflow's Python steps on Python 3.10, 3.12 and 3.14.
name: Checks

on:
Expand All @@ -10,6 +11,12 @@ on:
permissions:
contents: read

# A newer push to a pull request cancels the checks still running for the older one. Pushes to main are never cancelled,
# so every commit on main keeps its own result.
concurrency:
group: checks-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
actionlint:
runs-on: ubuntu-latest
Expand All @@ -19,18 +26,152 @@ jobs:
with:
persist-credentials: false
# Go's module proxy and checksum database verify the pinned version. shellcheck, which actionlint uses for
# `run:` scripts, is preinstalled on ubuntu-latest.
# `run:` scripts, is preinstalled on ubuntu-latest. Files are named explicitly so the example caller workflows,
# which are not under .github/workflows, are linted too.
- name: actionlint
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -color
run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.12 -color .github/workflows/*.yml examples/*.yml

# Audits the workflows, the example callers and the Dependabot configuration for security problems. Fails on any
# finding, of any severity, with zizmor's default ("regular") persona. zizmor exits with 11 to 14 when it has
# findings, whatever the output format; only --format=sarif and --no-exit-codes (and --fix, once it fixed
# everything) turn that off, so --format=github fails the job. See "Exit codes" at https://docs.zizmor.sh/usage/. A finding is either fixed or accepted with
# an inline `# zizmor: ignore[<audit>] <reason>` comment on the line zizmor reports. Findings show as annotations
# on the pull request.
zizmor:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Pinned by version with hashes, in .github/zizmor/requirements.txt. Installed into its own virtual environment
# because the runner's Python does not allow installing packages into it.
- name: Install zizmor
run: |
python3 -m venv "$RUNNER_TEMP/zizmor"
"$RUNNER_TEMP/zizmor/bin/pip" install --quiet --no-deps --only-binary :all: --require-hashes \
--requirement .github/zizmor/requirements.txt
# The repository root gives zizmor .github/workflows/ and .github/dependabot.yml. The example callers are not
# under .github/workflows/, so each is named explicitly, if there are any. The token lets zizmor's online
# audits check that each pinned commit belongs to its action's repository and has no known vulnerability.
- name: Audit
env:
GH_TOKEN: ${{ github.token }}
run: |
shopt -s nullglob
"$RUNNER_TEMP/zizmor/bin/zizmor" --persona=regular --format=github . examples/*.yml

request-decision:
# Checks the workflow lockfile, .github/workflows/actions.lock, made by `gh actions-lock` and never by hand. Once it
# is committed, fails unless `gh actions-lock --verify` passes and running `gh actions-lock` changes nothing, neither
# the lockfile nor the workflows (it rewrites a commit-pinned `uses:` to the version tag, keeping the commit in the
# lockfile, and GitHub refuses to start a workflow that has both). Until it is committed, only warns. Either way,
# the job summary carries what `gh actions-lock` made from this pull request's workflows, so it can be reviewed and
# committed without installing the extension.
actions-lock:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
env:
# The gh-actions-lock extension's release, and the SHA-256 of its linux-amd64 binary as the release lists it. To
# update them, see "Updating gh-actions-lock" in the README.
GH_ACTIONS_LOCK_VERSION: v0.4.1
GH_ACTIONS_LOCK_SHA256: 39deb2fe714dbf74b073d8245fc7f3d50cd0eee18d5c0900e9e849ae933ae17e
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# `gh extension install github/gh-actions-lock` cannot check a hash, so the pinned binary is downloaded, checked
# against its hash, and installed from a local directory instead. gh installs a local extension from the current
# directory only, and the directory's name must be the extension's.
- name: Install gh-actions-lock
env:
GH_TOKEN: ${{ github.token }}
run: |
dir="$RUNNER_TEMP/gh-actions-lock"
mkdir -p "$dir"
curl --fail --silent --show-error --location --proto '=https' --output "$dir/gh-actions-lock" \
"https://github.com/github/gh-actions-lock/releases/download/$GH_ACTIONS_LOCK_VERSION/linux-amd64"
echo "$GH_ACTIONS_LOCK_SHA256 $dir/gh-actions-lock" | sha256sum --check --strict
chmod +x "$dir/gh-actions-lock"
(cd "$dir" && gh extension install .)
gh actions-lock --version
# The logic is in .github/scripts/check-lock, which tests/test_check_lock.py tests. BASE_REF goes in the
# environment rather than into the script text, so that nothing from the pull request is read as shell.
- name: Check the lockfile
env:
GH_TOKEN: ${{ github.token }}
BASE_REF: ${{ github.base_ref }}
run: .github/scripts/check-lock

# Lints the repository's Python (steps/, tests/ and any other file) with Ruff and type-checks it with mypy, as
# configured in pyproject.toml. Both run even if the other fails, and either fails the check on any finding.
python-checks:
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Pinned by version with hashes, mypy's dependencies included, in .github/python-checks/requirements.txt.
# Installed into its own virtual environment because the runner's Python does not allow installing packages
# into it. Wheels only, so no package's build step runs.
- name: Install Ruff and mypy
id: install
run: |
python3 -m venv "$RUNNER_TEMP/python-checks"
"$RUNNER_TEMP/python-checks/bin/pip" install --quiet --only-binary :all: --require-hashes \
--requirement .github/python-checks/requirements.txt
"$RUNNER_TEMP/python-checks/bin/ruff" --version
"$RUNNER_TEMP/python-checks/bin/mypy" --version
- name: Ruff
run: '"$RUNNER_TEMP/python-checks/bin/ruff" check --output-format=github .'
# mypy checks the files listed in pyproject.toml, for Python 3.10, whichever Python runs it.
- name: mypy
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
run: '"$RUNNER_TEMP/python-checks/bin/mypy"'

# Runs both test seams: the unit tests of the reusable workflow's Python steps on each Python version a GitHub-hosted
# Ubuntu runner may provide, and the request decision's saved cases (and the check of their test script), which use
# only bash and jq, once, in the leg the matrix marks with saved-cases. 3.10 is the oldest the steps support, and
# 3.14 covers the runner's own python3, whatever ubuntu-latest provides. jq and yq are the ones preinstalled on
# ubuntu-latest, which setup-python leaves on the PATH. The tests need nothing installed and no network beyond
# 127.0.0.1.
tests:
name: tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
contents: read
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.12', '3.14']
include:
- python-version: '3.14'
saved-cases: true
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Check the test script
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with:
python-version: ${{ matrix.python-version }}
- name: Show the versions
run: |
python3 --version
jq --version
yq --version
- name: Check the saved cases' test script
if: ${{ matrix.saved-cases }}
run: request-decision/test-runner
- name: Run the saved cases
if: ${{ !cancelled() && matrix.saved-cases }}
run: request-decision/test
- name: Run the unit tests
if: ${{ !cancelled() }}
run: python3 -m unittest discover --start-directory tests --verbose
Loading
Loading