ReviewOS

craft-native/craft

release: reject tag/version mismatches and branch dispatches

#272
Closed glennmichael123 opened this 9 days ago ·
9 days ago

Problem

.github/workflows/release.yml publishes on v* tags and also supports workflow_dispatch, but it only extracts .version from package.json. It never asserts that github.ref_name is v${version}, nor that a manual dispatch is running from a tag.

That leaves two release-integrity failure modes:

  • a mistyped or stale tag can publish artifacts whose embedded/package version disagrees with the GitHub release tag;
  • a manual dispatch from main or another branch can reach the Pantry/NPM publish steps while github.ref_name is a branch name.

This was found during the release-readiness audit following #254, #242, and #220. It is outside those issue lanes.

Evidence

  • trigger: push.tags: v* plus unrestricted workflow_dispatch
  • version source: jq -r .version package.json
  • release/verification identity: github.ref_name
  • no equality/ref-type guard exists before either publish path

Suggested acceptance criteria

  • Before any build or publish, require a tag ref.
  • Require the tag to equal v plus the canonical workspace version.
  • Verify all publishable package manifests and packages/zig/build.zig.zon carry that same version.
  • Fail with a diagnostic naming every mismatch.
  • Keep manual reruns possible by dispatching against an existing tag.
  • Add a deterministic test/script for matching, mismatched, malformed, and branch-ref inputs.

Sign in to comment on this issue.