You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: publish-cask patches the wrong stanza's sha256, corrupting the Homebrew cask #87
The publish-cask job in .github/workflows/release.yml patches the wrongsha256 line in the Homebrew cask. brew install unbound-force/tap/replicator is currently broken on macOS arm64 and Linux amd64 at v0.5.0.
This is a distinct defect from #81 (which addressed the TOCTOU/skip gap by extracting publish-cask). That extraction was correct; the awk targeting inside it is not.
Root cause
GoReleaser emits each stanza as sha256thenurl, so the darwin_arm64 marker appears after the sha256 line it belongs to:
on_macosdoon_armdosha256"..."# line 7 <- belongs to darwinurl".../darwin_arm64.tar.gz"# line 8 <- marker seen here
The awk scans forward from the marker for the next sha256, which is the linux_amd64 stanza's line.
Evidence (v0.5.0)
Cask line
Stanza
Published SHA
Actual artifact SHA
7
darwin_arm64
ea3278e2…
33683ca5… ❌ stale
14
linux_amd64
33683ca5… (darwin's)
db3f96fc… ❌ clobbered
18
linux_arm64
d35cf511…
d35cf511… ✅
Replaying the shipped awk against the real cask reproduces exactly this: it patches line 14, not line 7.
The replicator.rbrelease asset is clean for both Linux stanzas — the corruption is introduced by the patch step and exists only in the tap.
Why it was not caught
The verification guard is a file-wide grep -q "sha256 \"$ARM64_SHA\"". Because the darwin SHA was written into the file (onto the linux line), the grep passed and the corrupt cask shipped.
openspec/changes/fix-homebrew-sha-mismatch/specs/release-pipeline.md already requires verification "in the correct context (associated with the darwin_arm64 section)" — that requirement is unmet by the current implementation.
Impact
macOS arm64: stale pre-signing checksum -> mismatch
Linux amd64: darwin's checksum -> mismatch
Linux arm64: unaffected
Fix
Bind the darwin_arm64 marker to the nearest precedingsha256 line, fail loudly when no such line exists, and make the verification stanza-aware so a mispatch cannot clear the gate.
Activity
fix(release): validate and test Homebrew cask checksums
docs(openspec): specify tested cask checksum patching