test(ci): guard the workflow action pins against regressing to tags - #96
Closed
DeepDiver1975 wants to merge 1 commit into
Closed
test(ci): guard the workflow action pins against regressing to tags#96DeepDiver1975 wants to merge 1 commit into
DeepDiver1975 wants to merge 1 commit into
Conversation
The org Actions policy sets `allowed_actions: selected` together with `sha_pinning_required: true` (owncloud/admin:actions-allowlist.yml), so an action referenced by a movable tag is rejected even though `actions/*` is allowed as GitHub-owned. GitHub enforces that *before* it creates any job: the run ends as `startup_failure` with no jobs, no logs and no check-runs at all, so the required `build` check never reports and every PR silently becomes unmergeable -- the outage #94 fixed. The only trace is an annotation on the run page, which the REST API does not expose, so a repeat of #94 is disproportionately expensive to diagnose from the Actions UI. Assert the invariant where it is cheap to see instead -- `npm test`: - every `uses:` is pinned to a full-length (40 hex) commit SHA - every pin carries a `# vX.Y.Z` comment, so the SHA stays reviewable and Dependabot knows which version it currently represents - the workflows yield at least one `uses:` ref, so a parse that matches nothing cannot make the two assertions above vacuously pass Local (`./`) and container (`docker://`) refs are not action repositories and are out of scope for the policy, so they are skipped. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Thomas Müller <1005065+DeepDiver1975@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #94, which fixed the pins but left nothing guarding them.
Why
The org Actions policy sets
allowed_actions: selectedtogether withsha_pinning_required: true(owncloud/admin:actions-allowlist.yml). An actionreferenced by a movable tag is therefore rejected even though
actions/*isallowed as GitHub-owned —
github_owned_allowedand the SHA-pinning requirementare independent gates, which is the non-obvious part.
GitHub enforces this before it creates any job, so the failure mode is unusually
opaque:
startup_failure— no jobs, no logs, no check-runsbuildcheck therefore never reports, and every PR silentlybecomes unmergeable, on
mainand Dependabot branches alikeexpose (
/actions/runs/{id}/jobsreturns[],--logreturns "log not found")That combination made #94 disproportionately expensive to diagnose. This asserts
the invariant somewhere cheap instead:
npm test.What it checks
uses:is pinned to a full-length (40 hex) commit SHA# vX.Y.Zcomment, so the SHA stays reviewable andDependabot knows which version it currently represents
uses:ref, so a parse that matches nothingcannot make the two assertions above vacuously pass
Local (
./) and container (docker://) refs are not action repositories and areout of scope for the policy, so they are skipped.
Verification
Written before #94's fix and confirmed to fail on exactly the four offending refs
(
ci.yml:27,:30,:49,:70). Re-checked on this branch by reverting one pinto
actions/checkout@v7:npm teston this branch: 20 tests, 16 pass, 0 fail, 4 skipped (the pre-existingpublic/-not-built skips).No workflow or runtime change — test-only.
🤖 Generated with Claude Code