Skip to content

bug(release): strengthen post-patch cask validation to be stanza-aware #89

Description

@yvonnedevlinrh

Context

The publish-cask job in release.yml validates the SHA patch with:

grep -q "sha256 \"$ARM64_SHA\"" "$CASK_FILE"

This checks that the SHA exists anywhere in the cask file, not specifically in the darwin_arm64 stanza. Prior to #86, this grep was falsely passing — it found the SHA in the wrong stanza (linux_amd64) and reported success.

With #86 merged the patching logic is correct, but the validation is still not stanza-aware. A future regression in the AWK script could silently pass this check again.

Suggested fix

Replace the grep with a stanza-aware check, e.g.:

if ! awk '/darwin_arm64/{found=1} found && /sha256.*'"$ARM64_SHA"'/{ok=1} END{exit !ok}' "$CASK_FILE"; then
  echo "::error::SHA not found in darwin_arm64 stanza"
  exit 1
fi

Priority

Low — the core bug is fixed by #86. This is a defense-in-depth improvement

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggithub_actionsPull requests that update GitHub Actions code

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions