From d6461abe966540da26f626ec33b28c6bbd966a11 Mon Sep 17 00:00:00 2001 From: homelabforge Date: Tue, 6 Oct 2026 09:55:26 -0500 Subject: [PATCH 1/2] fix: call verify-pytest-shards through $/ (v1.7.0-rc2) mygarage requires SHA-pinned actions, so both keepers died on the @v1.7.0-rc1 action ref before running a step. $/ resolves to this repo at the commit the consumer called, which needs no pin and no lockstep. check_suite.py now fails on any other form of our own action ref, and actionlint (no release knows $/ yet) skips just that one message. Co-Authored-By: Claude Opus 5.5 --- .github/actionlint.yaml | 6 ++++++ .github/scripts/check_suite.py | 25 ++++++++++++++++++++-- .github/workflows/_python-react-tests.yml | 2 +- .github/workflows/python-react-ci.yml | 6 +++--- .github/workflows/python-react-publish.yml | 2 +- .github/workflows/release.yml | 12 +++++------ CHANGELOG.md | 5 +++++ 7 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 .github/actionlint.yaml diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..0b60bf3 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,6 @@ +# actionlint 1.7.12 and older don't know `$/` refs yet and flag them as a +# missing ref. check_suite.py makes sure our own actions go through `$/`. +paths: + .github/workflows/**/*.{yml,yaml}: + ignore: + - 'specifying action "\$/\.github/actions/[^"]+" in invalid format because ref is missing' diff --git a/.github/scripts/check_suite.py b/.github/scripts/check_suite.py index 10f08d2..af02f19 100644 --- a/.github/scripts/check_suite.py +++ b/.github/scripts/check_suite.py @@ -6,6 +6,8 @@ breaks on the next tag and nothing notices before then. 2. The jobs holding required-check names can't be skipped, and no other job uses those names. A skipped job reports Success to branch protection. +3. Steps call this repo's own actions through `$/`. A consumer that requires + SHA-pinned actions refuses a tag ref, and `./` means the consumer's checkout. """ import sys @@ -14,6 +16,7 @@ import yaml WORKFLOWS = Path(".github/workflows") +ACTIONS = Path(".github/actions") SUITE = "_python-react-tests.yml" CALLERS = ("python-react-ci.yml", "python-react-publish.yml") # keeper job id -> (required name, jobs it must wait for) @@ -101,12 +104,30 @@ def check_keepers() -> list[str]: return problems +def check_action_refs() -> list[str]: + problems: list[str] = [] + files = sorted(WORKFLOWS.glob("*.yml")) + sorted(ACTIONS.glob("*/action.yml")) + for path in files: + doc = yaml.safe_load(path.read_text(encoding="utf-8")) + steps = [ + s for job in doc.get("jobs", {}).values() for s in job.get("steps", []) + ] + steps += doc.get("runs", {}).get("steps", []) + for step in steps: + uses = str(step.get("uses", "")) + if ".github/actions/" in uses and not uses.startswith("$/"): + problems.append(f"{path}: {uses} has to be $/.github/actions/...") + return problems + + def main() -> int: - problems = check_plumbing() + check_keepers() + problems = check_plumbing() + check_keepers() + check_action_refs() for problem in problems: print(f"::error::{problem}") if not problems: - print("OK: suite inputs plumbed through, keepers can't be skipped") + print( + "OK: suite inputs plumbed through, keepers can't be skipped, own actions via $/" + ) return 1 if problems else 0 diff --git a/.github/workflows/_python-react-tests.yml b/.github/workflows/_python-react-tests.yml index b97d2da..ba35739 100644 --- a/.github/workflows/_python-react-tests.yml +++ b/.github/workflows/_python-react-tests.yml @@ -192,7 +192,7 @@ jobs: - name: Every test module ran exactly once if: inputs.backend-test-shards > 1 - uses: homelabforge/shared-workflows/.github/actions/verify-pytest-shards@v1.7.0-rc1 + uses: $/.github/actions/verify-pytest-shards with: reports-dir: shard-reports count: ${{ inputs.backend-test-shards }} diff --git a/.github/workflows/python-react-ci.yml b/.github/workflows/python-react-ci.yml index 5c6168c..a7fb9e1 100644 --- a/.github/workflows/python-react-ci.yml +++ b/.github/workflows/python-react-ci.yml @@ -5,7 +5,7 @@ name: Reusable Python+React CI # # jobs: # ci: -# uses: homelabforge/shared-workflows/.github/workflows/python-react-ci.yml@v1.7.0-rc1 +# uses: homelabforge/shared-workflows/.github/workflows/python-react-ci.yml@v1.7.0-rc2 # with: # enable-translations: true # security-tripwire-script: .github/scripts/security-tripwire.sh @@ -109,7 +109,7 @@ jobs: # local path resolves against the CONSUMER repo (which has no such file) # when this reusable workflow is called cross-repo, causing a 0s # startup_failure. Bump the @ref on every release. - uses: homelabforge/shared-workflows/.github/workflows/_python-react-tests.yml@v1.7.0-rc1 + uses: homelabforge/shared-workflows/.github/workflows/_python-react-tests.yml@v1.7.0-rc2 with: python-version: ${{ inputs.python-version }} bun-version-file: ${{ inputs.bun-version-file }} @@ -281,7 +281,7 @@ jobs: - name: Every test module ran exactly once if: inputs.pg-migrations-shards > 1 - uses: homelabforge/shared-workflows/.github/actions/verify-pytest-shards@v1.7.0-rc1 + uses: $/.github/actions/verify-pytest-shards with: reports-dir: shard-reports count: ${{ inputs.pg-migrations-shards }} diff --git a/.github/workflows/python-react-publish.yml b/.github/workflows/python-react-publish.yml index 1c3321b..1ee374a 100644 --- a/.github/workflows/python-react-publish.yml +++ b/.github/workflows/python-react-publish.yml @@ -86,7 +86,7 @@ jobs: # Full owner/repo path pinned to this release's own tag — a `./` local path # resolves against the CONSUMER repo when called cross-repo (0s # startup_failure). Bump the @ref on every release. - uses: homelabforge/shared-workflows/.github/workflows/_python-react-tests.yml@v1.7.0-rc1 + uses: homelabforge/shared-workflows/.github/workflows/_python-react-tests.yml@v1.7.0-rc2 with: python-version: ${{ inputs.python-version }} bun-version-file: ${{ inputs.bun-version-file }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 01d65c5..162722e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,9 @@ name: Release # # Two gates, mirroring the app repos (which gate `release` on `tests`): # 1. ref-lockstep: every internal `homelabforge/shared-workflows/...@` -# pin must equal the tag: the `_python-react-tests.yml` calls in the -# CI/publish workflows and, since v1.7.0, the verify-pytest-shards action -# in the suite and the PG job. A `./` path can't be used (it +# pin must equal the tag, i.e. the `_python-react-tests.yml` calls in the +# CI/publish workflows. Our own actions go through `$/` and have no ref. +# A `./` path can't be used (it # startup-fails cross-repo — broke v1.4.0), so the pin must be bumped every # release; forgetting it makes the tag silently ship the OLD suite. This # gate fails the release if the refs drift. (Was release-tag-guard.yml.) @@ -38,10 +38,8 @@ jobs: status=0 for f in \ .github/workflows/python-react-ci.yml \ - .github/workflows/python-react-publish.yml \ - .github/workflows/_python-react-tests.yml; do - # Every `uses:` back into this repo has to name the tag being cut: - # the nested test suite and the verify-pytest-shards action alike. + .github/workflows/python-react-publish.yml; do + # Every `uses:` back into this repo has to name the tag being cut. # Anchored on real `uses:` lines so a comment can't satisfy it. refs=$(grep -E '^[[:space:]-]*uses:[[:space:]]*homelabforge/shared-workflows/' "$f" \ | grep -oE '@[^[:space:]]+' | sed 's/^@//' || true) diff --git a/CHANGELOG.md b/CHANGELOG.md index efde3f2..44562be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.7.0-rc2] - 2026-10-06 + +### Fixed +- The shard verify step calls its action through `$/`, so it runs in repos that require SHA-pinned actions (needs runner 2.336.0+). + ## [1.7.0-rc1] - 2026-10-06 ### Added From 38878fe86d79220f3b4a33fcb76a553b4f1bef22 Mon Sep 17 00:00:00 2001 From: homelabforge Date: Tue, 6 Oct 2026 09:56:51 -0500 Subject: [PATCH 2/2] fix(release): keep scanning the suite file for internal refs Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 162722e..a7435a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,9 +5,9 @@ name: Release # # Two gates, mirroring the app repos (which gate `release` on `tests`): # 1. ref-lockstep: every internal `homelabforge/shared-workflows/...@` -# pin must equal the tag, i.e. the `_python-react-tests.yml` calls in the -# CI/publish workflows. Our own actions go through `$/` and have no ref. -# A `./` path can't be used (it +# pin must equal the tag; today that's the `_python-react-tests.yml` +# calls in the CI/publish workflows. Our own actions go through `$/` and +# have no ref. A `./` path can't be used (it # startup-fails cross-repo — broke v1.4.0), so the pin must be bumped every # release; forgetting it makes the tag silently ship the OLD suite. This # gate fails the release if the refs drift. (Was release-tag-guard.yml.) @@ -38,11 +38,16 @@ jobs: status=0 for f in \ .github/workflows/python-react-ci.yml \ - .github/workflows/python-react-publish.yml; do + .github/workflows/python-react-publish.yml \ + .github/workflows/_python-react-tests.yml; do # Every `uses:` back into this repo has to name the tag being cut. # Anchored on real `uses:` lines so a comment can't satisfy it. refs=$(grep -E '^[[:space:]-]*uses:[[:space:]]*homelabforge/shared-workflows/' "$f" \ | grep -oE '@[^[:space:]]+' | sed 's/^@//' || true) + # The suite calls nothing back here today; the callers always do. + if [ -z "$refs" ] && [ "$f" = .github/workflows/_python-react-tests.yml ]; then + continue + fi if [ -z "$refs" ]; then echo "::error file=$f::no homelabforge/shared-workflows/...@ found (expected refs pinned to $TAG)" status=1