chore(ci): skip no-op publishes; stop trying to push release commit#195
Merged
Conversation
The previous probe ran `release-it --release-version --ci --no-npm --no-github` and grepped the output for a semver. When no commits match the `(modal)` scope filter, the conventional-changelog plugin returns no recommendation and release-it's Version plugin falls back to a CI patch of `latestVersion` (which is `0.0.0` here because no `magic-modal-*` tag exists yet). That printed `0.0.1`, which is not the current package version (`7.0.1`), so the skip check incorrectly proceeded to publish. Replace it with a deterministic git-history probe: pick the most recent of (last `magic-modal-*` tag, last `chore(release):` commit, last `chore(modal): sync version` commit) as the boundary, then grep `git log <boundary>..HEAD` for `(modal)`-scoped commits or `BREAKING CHANGE` footers. Zero matches => skip cleanly. Also flip `.release-it.js` `git.push` to `false`. The `GH_PAT` secret (2024-vintage) is being rejected by branch protection on push, which crashed the workflow AFTER `npm publish` had already succeeded and left npm and main desynced. Keep `commit: true` and `tag: true` so the `@release-it/github` plugin still has a local tag to attach the release to on the runner; sync the version bump back to main via a follow-up PR (same pattern as #192). `fetch-depth: 0` is added to checkout so the probe can see full history.
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Modal package release automation to (1) reliably skip no-op publishes based on deterministic git-history checks and (2) avoid failing the workflow by attempting to push release commits/tags back to main from CI.
Changes:
- Disable
release-it’sgit.pushforpackages/modalto stop CI from pushing release commits/tags tomain. - Update the
🚀 Publishworkflow to fetch full git history and replace the “next version” probe with a boundary + commit-message-based qualifying-commit scan. - Improve workflow inline documentation around the previous failure mode and the new release boundary logic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
packages/modal/.release-it.js |
Disables CI pushing of release commit/tag while keeping local commit+tag creation for the release run. |
.github/workflows/release.yml |
Fetches full history and replaces the version probe with deterministic boundary/grep logic to skip no-op publishes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Without these, the E2E workflow doesn't fire when a PR is first opened — it only fires on subsequent commits (synchronize). That caused PR #195 to sit in BLOCKED without ever running the required check until an empty commit was pushed.
Comment on lines
+109
to
+112
| # `\(modal\)` matches scoped commits; `BREAKING[- ]CHANGE` matches | ||
| # the footer added by conventional-commits for breaking changes. | ||
| QUALIFY=$(git log "$BOUNDARY..HEAD" -E --grep='\(modal\)|BREAKING[- ]CHANGE' --pretty=%s || true) | ||
| if [ -z "$QUALIFY" ]; then |
Comment on lines
+91
to
96
| // | ||
| // TODO: once GH_PAT is rotated with `contents: write` and granted | ||
| // bypass on branch protection, flip `push` back to `true`. | ||
| push: false, | ||
| requireCleanWorkingDir: false, | ||
| tagName: "magic-modal-${version}", |
GSTJ
added a commit
that referenced
this pull request
May 19, 2026
The skip probe in `release.yml` (added in #195) used `git log --grep` which scans the entire commit message body. The squashed PR description for #195 mentioned `BREAKING CHANGE` in its explanation prose, which falsely matched the regex → skip=false → release-it bumped to 7.0.2 and tried to publish. Net effect: 7.0.2 got published (npm has it), then the workflow died on git push permission. Workflow status: red on main. ## Fix Replace `git log --grep` with explicit per-commit (subject, body) iteration using ASCII unit/record separators. Match `(modal)` only in the subject line, and require `BREAKING CHANGE:` (or `BREAKING-CHANGE:`) to start a body line — i.e. the actual conventional-commits footer form, not a mention in prose. Verified locally on `origin/main`: the merge commit of #195 is now correctly classified as non-qualifying. ## Expected behavior next push to main - This PR is `fix(ci):` (no `(modal)` scope, no `BREAKING CHANGE:` footer) - → boundary scan finds zero qualifying commits since #192 - → skip=true → workflow exits green
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two bugs in the
🚀 Publishworkflow that combined to cause an unintended publish (and then a failedgit pushto main) on every push.Issue 1 — skip probe always proceeded
The probe ran
release-it --release-version --ci --no-npm --no-githuband grepped its stdout for the next version. When no commits matched the(modal)scope filter, the conventional-changelog plugin returned no recommendation; release-it's Version plugin then fell back to its CI default ofpatch(latestVersion). Because there is nomagic-modal-*git tag yet,latestVersionwas0.0.0, so the probe printed0.0.1.0.0.1 != 7.0.1→ the skip check proceeded → release-it bumped to7.0.2and published.Replaced with a deterministic git-history probe:
magic-modal-*tag, lastchore(release):commit, lastchore(modal): sync versioncommit.git log <boundary>..HEADfiltered by(modal)scope orBREAKING CHANGEfooter (mirrors thecommitFilterin.release-it.js).skip=true.Verified locally on current
main: boundary correctly resolves to08d293e(the #192 sync commit) andskip=true.Issue 2 —
GH_PATpush deniedThe
🚀 Releasestep failed withPermission to GSTJ/react-native-magic-modal.git denied to GSTJwhen release-it tried to push the version-bump commit back to main. The PAT (vintage 2024) is no longer accepted by branch protection.Set
git.push: falseinpackages/modal/.release-it.js.commitandtagstaytrueso the@release-it/githubplugin still has a local tag to bind the GitHub Release to on the runner. The version bump is now runner-local only; sync tomainvia a follow-up PR when needed (same pattern as #192).TODOcomment left in the config to re-enablepushonceGH_PATis rotated withcontents: write+ branch-protection bypass.Also added
fetch-depth: 0to the checkout so the probe can see full history.Test plan
skip=trueon currentmain(no qualifying commits since the chore(modal): sync version, broaden release filter, skip empty publishes #192 sync)feat(modal):case —git loggrep matches →skip=falsepnpm typecheckpassesactionlintpasses structurally (only pre-existing SC2086 warnings, unrelated)