internal(fix): Gate GitHub releases on hasChangesets instead of published#3816
internal(fix): Gate GitHub releases on hasChangesets instead of published#3816
Conversation
…shed `published == 'true'` is never satisfied because changesets/action cannot detect publications from the custom `yarn workspaces foreach` publish command. Use `hasChangesets == 'false'` which reliably indicates the Version Packages PR was merged and publish executed. Made-with: Cursor
|
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3816 +/- ##
=======================================
Coverage 98.06% 98.06%
=======================================
Files 151 151
Lines 2843 2843
Branches 556 556
=======================================
Hits 2788 2788
Misses 11 11
Partials 44 44 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Motivation
GitHub releases were being created on every push to master, even when only adding a changeset (before the Version Packages PR is merged and npm publish runs). This happened because the
create-github-releases.mjsscript ran unconditionally.The previous fix (
published == 'true') was tried three times (d3c2a0b, f526931, 21834d2) and reverted each time becausechangesets/actioncannot detect publications from the customyarn workspaces foreach ... npm publishcommand —publishedis never'true'.Solution
Gate the "Create GitHub Releases" step on
hasChangesets == 'false'instead. This output is reliable because it simply checks whether.changeset/*.mdfiles exist, independent of the publish command:hasChangesets = 'true'→ skip releaseshasChangesets = 'false'→ publish runs, then create releaseshasChangesets = 'false'→ script runs but is idempotent (all releases already exist)Open questions
N/A
Made with Cursor
Note
Low Risk
Low risk workflow-only change that just conditions when
scripts/create-github-releases.mjsruns; main risk is skipping release creation ifhasChangesetsoutput behavior changes.Overview
Updates the release GitHub Action to only run the “Create GitHub Releases” step when
steps.changesets.outputs.hasChangesets == 'false', preventing release creation on pushes that merely add changesets.Adds matching inline documentation in
scripts/create-github-releases.mjsto clarify that release creation is CI-gated byhasChangesetsrather thanpublished.Written by Cursor Bugbot for commit e078faa. This will update automatically on new commits. Configure here.