Don't attempt to publish when there's no pending release #205
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.
Currently our release process is kicked off whenever a PR is merged and there are no changesets within the
.changeset
directory. Typically this happens when we intend to publish a release, just after we merge a "Version Packages" PR which removes the changesets and adds the entries to our changelog.However, this also means that merging any PR without user-facing changes during the period after we've made a release will trigger another release (which luckily fails because the created tag already exists on the remote. See #184).
This change avoids that scenario by fetching tags when checking out the repo. Now when
npx changeset tag
runs, it will see that the tag already exists and skip creating it (🦋 Skipping tag (already exists): v3.3.2
). Thegit push --tags
step will no longer throw an error (Everything up-to-date
). And lastly, the publish step won't get triggered because the output fromnpx changeset tag
doesn't contain the textNew tag:
. The action should just finish successfully with nothing to left do.Fixes #184