Skip to content

Add preflight guard to release scripts - #106

Merged
eNkru merged 1 commit into
mainfrom
chore/release-preflight
Oct 5, 2026
Merged

eNkru merged 1 commit into
mainfrom
chore/release-preflight

Conversation

@eNkru

@eNkru eNkru commented Oct 5, 2026

Copy link
Copy Markdown
Owner

What

Prefixes release:patch / release:minor / release:major with a new release:preflight script that fails fast unless:

  • you are on main (release commits/tags must not land on a feature branch)
  • the working tree has no uncommitted changes (otherwise unrelated dirty files get left behind or swept into the release commit)

Why

A release is a one-command chain (npm version → sync → check → commit → tag → push → CI builds & publishes). If it runs from the wrong branch or with a dirty tree, the tag goes out anyway and cleanup is manual. The guard makes those two mistakes impossible.

Tested

  • ✅ clean tree on main → passes
  • ✅ dirty tree → release: aborting, uncommitted changes: … (and release:patch stops before the version bump — package.json untouched)
  • ✅ on a feature branch → release: aborting, not on main: <branch>

@eNkru
eNkru merged commit 6417315 into main Oct 5, 2026
1 check passed
@eNkru
eNkru deleted the chore/release-preflight branch October 5, 2026 09:54
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