Skip to content

fix(ci): make the release dispatch refuse anything but its own tag - #54

Closed
johncarmack1984 wants to merge 1 commit into
mainfrom
john/release-dispatch-guard
Closed

fix(ci): make the release dispatch refuse anything but its own tag#54
johncarmack1984 wants to merge 1 commit into
mainfrom
john/release-dispatch-guard

Conversation

@johncarmack1984

Copy link
Copy Markdown
Collaborator

A manual workflow_dispatch of the release workflow ran the publish job unconditionally, and the tag input was optional with the documented behaviour "leave blank to build current main". The publish step writes to a key derived from version.txt, so a blank dispatch builds main and overwrites whatever release that version already published, with a different binary under its name.

That is not hypothetical. I did it tonight: dispatched with no tag to re-test release-please, and it replaced the shipped v1.0.0 DMG with a build of main. Signed and notarized, so it opens, but it is not the artifact that passed QA. No customer had bought it, which is the only reason this cost nothing.

Two changes:

  • tag is now required on dispatch.
  • A guard step runs before anything is built and refuses unless the tag exists, HEAD is exactly that tag's commit, and version.txt at that tag matches it. Any mismatch fails the job before the signing secret is even loaded.

fetch-depth: 0 so the guard can resolve tags.

Not covered here

newearth-llc-downloads has no bucket versioning, which is why the original DMG was unrecoverable. That bucket is Terraformed in the newearth.llc repo (infra-downloads/), so it needs a change over there. A one-line aws_s3_bucket_versioning would have made this a single-command restore.

A manual dispatch ran the publish job unconditionally with an optional
tag input documented as "leave blank to build current main". Publish
writes to a key derived from version.txt, so a blank dispatch builds main
and overwrites whatever release that version already published.

I did exactly that tonight and replaced the shipped v1.0.0 DMG with a
build of main. Signed and notarized, so it opens, but not the artifact
that passed QA.

The tag input is required now, and a guard refuses unless the tag exists,
HEAD is that tag's commit, and version.txt at the tag matches it. It runs
before the signing secret is loaded.
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