Skip to content

Harden release CI: require released commit on main#8

Merged
aram356 merged 1 commit into
mainfrom
chore/harden-release-ci
Jun 3, 2026
Merged

Harden release CI: require released commit on main#8
aram356 merged 1 commit into
mainfrom
chore/harden-release-ci

Conversation

@aram356
Copy link
Copy Markdown
Owner

@aram356 aram356 commented Jun 3, 2026

Medium (release-safety)

release.yml previously only checked the release tag (minus v) against mix.exs @version, then ran mix hex.publish --yes. A GitHub Release on any off-mainline commit that still read the target @version would pass and publish. The plan had a manual SHA guard, but the workflow is the irreversible boundary, so the check belongs there.

This adds a second fail-hard gate in the workflow:

  • actions/checkout now uses fetch-depth: 0 (full history).
  • New step: git fetch --no-tags origin main then git merge-base --is-ancestor "$GITHUB_SHA" origin/main — aborts the publish if the released commit is not on main.

Verified locally: a commit on main passes; an off-mainline commit (the squash-merged revive-and-modernize tip) aborts.

Low (doc drift)

Synced 2026-06-02-hex-release-ci-design.md to the actual workflow: actions/checkout@v6, toolchain from .tool-versions (strict), and the new on-main gate.

actionlint clean.

@aram356 aram356 merged commit 2b18876 into main Jun 3, 2026
7 checks passed
@aram356 aram356 deleted the chore/harden-release-ci branch June 3, 2026 07:32
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