Skip to content

fix: repair 17 malformed SHA+tag action refs; add Frankenref guard (stack 8/8)#136

Merged
cryptoxdog merged 1 commit into
mainfrom
fix/action-refs
Jul 23, 2026
Merged

fix: repair 17 malformed SHA+tag action refs; add Frankenref guard (stack 8/8)#136
cryptoxdog merged 1 commit into
mainfrom
fix/action-refs

Conversation

@cryptoxdog

Copy link
Copy Markdown
Collaborator

Repair 17 malformed SHA+tag action references + recurrence guard

Stack position: main → #129#130#131#132#133#134#135this PR

Problem

Seventeen uses: references across four workflows had a 40-hex commit SHA and a version tag concatenated into a single string GitHub cannot resolve:

uses: anchore/sbom-action@fc46e51fb0e4e3ecf1ea2be3b2e00ee50f1c4e44v0.17.7   # BROKEN

Every affected job — dependency review, SBOM generation, OpenSSF Scorecard, all Docker build/sign/attest steps, and Helm/K8s deploy — failed before its first step could run.

File Refs fixed
ci.yml 3 (dependency-review, sbom-action, scorecard)
docker-build.yml 8 (qemu, buildx, login, metadata, build-push, cosign, sbom, attest)
k8s-deploy.yml 2 (setup-helm, k8s-set-context)
supply-chain.yml 4 (scorecard, dependency-review, sbom ×2)

Fix

All 17 refs are now pinned in the standard form:

uses: anchore/sbom-action@fc46e51fd3cb168ffb36c6d1915723c47db58abb # v0.17.7

Every SHA was verified against the upstream repository (2026-07-22) by resolving the claimed version tag via the GitHub API, dereferencing annotated tags to commit SHAs.

Notable finding: 5 of the 17 embedded SHAs did not exist in their upstream repos at all — they were fabricated by whatever automated edit produced the corruption:

Action Fabricated SHA (prefix) Verified real SHA (prefix)
actions/dependency-review-action@v4.5.0 5aa4f05e 3b139cfc
anchore/sbom-action@v0.17.7 fc46e51f b0e4… fc46e51f d3cb… (first 8 chars coincide)
sigstore/cosign-installer@v3.7.0 22642962 dc72c7d5
actions/attest-build-provenance@v2.0.0 1c608d11 619dbb2e
azure/k8s-set-context@v4.0.0 37ded6a3 27bfb387

The other 12 SHAs matched their claimed tags and only needed the separator repaired.

Recurrence guard

tools/check_action_refs.py + a new Validate Action References job in contracts.yml:

  • Fails CI on the @<sha>v<version> Frankenref pattern anywhere in .github/workflows/
  • Warns (non-fatal) on third-party actions not SHA-pinned
  • Verified locally: passes on this tree; correctly exits 1 on a synthetic Frankenref

Verification

  • All 10 workflow YAMLs parse cleanly after the fix
  • ruff check / ruff format --check pass on the guard script
  • Guard script tested in both pass and fail modes

Every affected ref had the form owner/action@<40-hex>v<semver> — a commit
SHA and a version tag concatenated into one string GitHub cannot resolve,
so each affected job (dependency review, SBOM, Scorecard, all Docker
build/sign steps, Helm/K8s deploy) died before its first step.

All 17 refs are now pinned as owner/action@<full-sha> # v<version>.
Each SHA was verified against the upstream repo on 2026-07-22 by
resolving the version tag through the GitHub API (annotated tags
dereferenced to commit SHAs). Five embedded SHAs did not exist in their
upstream repos at all (fabricated by the earlier automated edit):
dependency-review-action, sbom-action, cosign-installer,
attest-build-provenance, k8s-set-context — these were replaced with the
real tag SHAs; the other 12 embedded SHAs matched their claimed tags and
only needed the separator repaired.

tools/check_action_refs.py + a Validate Action References job in
contracts.yml now fail CI on the malformed pattern and warn on
unpinned third-party actions, so the corruption cannot recur silently.
@cursor

cursor Bot commented Jul 22, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@github-actions

Copy link
Copy Markdown

PR size is within recommended limits

@sonarqubecloud

Copy link
Copy Markdown

@cryptoxdog
cryptoxdog changed the base branch from fix/workflow-triggers-gates to main July 23, 2026 00:53
@cryptoxdog
cryptoxdog merged commit 8fe08c5 into main Jul 23, 2026
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant