Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

fix: revert 0.2.13 scan.yml structural pattern (0.2.14)#27

Merged
ob-aion merged 1 commit into
mainfrom
fix/scan-yml-revert-self-checkout
May 12, 2026
Merged

fix: revert 0.2.13 scan.yml structural pattern (0.2.14)#27
ob-aion merged 1 commit into
mainfrom
fix/scan-yml-revert-self-checkout

Conversation

@ob-aion
Copy link
Copy Markdown
Owner

@ob-aion ob-aion commented May 12, 2026

Summary

Hotfix that reverts the 0.2.13 scan.yml structural pattern. It broke on the first real cross-repo consumer call.

What broke

The 0.2.13 self-checkout pattern parsed github.workflow_ref and github.workflow_sha to clone the Pruner repo into .pruner-action and invoked the composite via uses: ./.pruner-action. Pruner's PR-only test-scan-yml.yml validator passed the pattern. That test called scan.yml locally (uses: ./.github/workflows/scan.yml); under local invocation both context variables resolve to the workflow's hosting repo.

The first remote invocation — coroboros/agent-skills/.github/workflows/ci.yml pinning ob-aion/pruner/.github/workflows/scan.yml@0.2.13 — failed. Logged values from the failing run:

WORKFLOW_REF: coroboros/agent-skills/.github/workflows/ci.yml@refs/pull/29/merge
FALLBACK_REPOSITORY: coroboros/agent-skills

The second checkout cloned agent-skills (no action.yml at root). uses: ./.pruner-action errored: "Can't find 'action.yml' under '.pruner-action'".

Why the pattern is structurally unfixable

GHA docs: "The github context, with the exception of github.token, references the calling workflow." No documented context exposes the called reusable workflow's own repo/ref/sha. Expressions in uses: action refs are not supported (actions/runner#1493, closed without implementation). The same chicken-and-egg is documented in ossf/scorecard-action/RELEASE.md. They hand-edit the manual two-step.

The test-scan-yml.yml validator carried a blind spot: same-repo-local-call does not validate cross-repo-remote-call behaviour. The consumer PR was the only real validation surface.

Changes

  • .github/workflows/scan.ymluses: ob-aion/pruner@0.2.14 literal restored. The 0.2.7 lockstep contract is back; one line bumps every release.
  • .github/workflows/test-scan-yml.yml — deleted. Tested a pattern that does not apply to the cross-repo case it was meant to protect.
  • <VERSION> placeholders in README.md, docs/consumer-integration.md (three refs), templates/workflow-{minimal,full}.yml — kept. Independent of the scan.yml lockstep. Never the source of the cross-repo bug.
  • CHANGELOG.md — v0.2.14 entry with the post-mortem.

Net effect against the pre-0.2.13 baseline

Metric Pre-0.2.13 0.2.13 (broken) 0.2.14 (hotfix)
Per-release file bumps 7 1 (claimed) 2
Lockstep contract on scan.yml:52 Required Removed (broken) Required
Example-pin sync (6 files) Required Gone Gone
Cross-repo invocation works Yes No Yes

Five-file improvement on example pins preserved. The structural shrink on scan.yml reverted.

Test plan

  • CI green on this PR.
  • Tag 0.2.14 cut. Release published with the signed bundle.
  • coroboros/agent-skills PR #29 rebumped to @0.2.14. Merged as 405bd0a with pruner / pruner green.
  • (Deferred) Extend scripts/verify-action-pins.sh to flag scan.yml's @X ≠ tag-being-cut. Catches the lockstep-skip bug class pre-tag.

…ocation

The 0.2.13 self-checkout pattern in `scan.yml` parsed `github.workflow_ref` and `github.workflow_sha` to derive the Pruner repo + SHA, then `actions/checkout`'d that into `.pruner-action` and invoked the composite via `uses: ./.pruner-action`. Pruner's own PR-only `test-scan-yml.yml` validated this pattern green — but it called `scan.yml` locally (`uses: ./.github/workflows/scan.yml`), in which case both context variables happen to point at the workflow's hosting repo.

The first real cross-repo consumer call (`coroboros/agent-skills@scan.yml@0.2.13`) failed because under remote invocation **the entire `github.*` context refers to the caller's workflow, not the called reusable workflow**. Logged values from the failing run: `WORKFLOW_REF=coroboros/agent-skills/.github/workflows/ci.yml@refs/pull/29/merge`, `FALLBACK_REPOSITORY=coroboros/agent-skills`. The second checkout cloned `agent-skills` (which has no `action.yml`) and `uses: ./.pruner-action` errored.

GHA docs are explicit: *"The `github` context, with the exception of `github.token`, references the calling workflow."* No documented context exposes the called reusable workflow's own repo/ref/sha; expressions in `uses:` action refs are not supported (`actions/runner#1493`). The pattern is structurally unfixable. `ossf/scorecard-action` documents the same chicken-and-egg in its `RELEASE.md` and lives with the manual two-step.

Restores `uses: ob-aion/pruner@0.2.14` literal at `scan.yml:52`. Deletes `test-scan-yml.yml` — it tested a pattern that does not apply to the cross-repo case it was meant to protect; false confidence. `<VERSION>` placeholders in `README.md`, `docs/consumer-integration.md`, and `templates/workflow-{minimal,full}.yml` survive — that convention is independent of the lockstep.

Net effect against the pre-0.2.13 baseline: per-release file bumps drop from seven to two (`CHANGELOG.md` plus `scan.yml`'s one-line literal). The five-file improvement on consumer-facing example pins is preserved; the structural shrink on `scan.yml` is not.
@ob-aion ob-aion merged commit 3678c83 into main May 12, 2026
7 checks passed
@ob-aion ob-aion deleted the fix/scan-yml-revert-self-checkout branch May 12, 2026 09:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant