fix(ci): pass --ref tag to publish workflow dispatches#1124
Merged
Conversation
release.yml dispatched publish-js.yml without --ref, so GITHUB_REF defaulted to refs/heads/main. publish-js classified this as pre-release and used --tag next instead of latest. This left npm latest stuck at 0.1.10 while 0.1.11-14 were only tagged as next. The release: [published] event does NOT trigger other workflows when the release is created with GITHUB_TOKEN (GitHub prevents recursive triggers), so explicit gh workflow run calls are the only working dispatch path. Fix: pass --ref $TAG to all gh workflow run calls so GITHUB_REF points to the release tag. Also add fallback in publish-js to check package.json version format for resilience against workflow_dispatch without --ref.
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
--ref $TAGto allgh workflow runcalls soGITHUB_REFpoints to the release tag instead ofrefs/heads/mainpackage.jsonversion format whenGITHUB_REFisn't a tagProblem
npm
latesttag has been stuck at 0.1.10 since v0.1.11. All subsequent versions (0.1.11–0.1.14) were published under thenextdist-tag instead.Root cause:
release.ymldispatches publish workflows viagh workflow runwithout--ref. Therelease: [published]event doesn't fire because GitHub prevents recursive workflow triggers fromGITHUB_TOKEN. Without--ref,GITHUB_REFdefaults torefs/heads/main, andpublish-js.ymlclassifies that as a pre-release →--tag next.Test plan
release.ymlpasses--ref $TAGto all three publish workflow dispatchespublish-js.ymldetermineslatesttag whenGITHUB_REFis a version tagpublish-js.ymlfalls back tolatestwhenpackage.jsonhas stable semverlatesttag updates correctly