Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't attempt to publish when there's no pending release #205

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

1000hz
Copy link
Contributor

@1000hz 1000hz commented Oct 30, 2023

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). The git 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 from npx changeset tag doesn't contain the text New tag:. The action should just finish successfully with nothing to left do.

Fixes #184

@1000hz 1000hz requested a review from a team as a code owner October 30, 2023 21:26
@1000hz 1000hz changed the title Don't trigger release process when there's no release Don't attempt to publish when there's no pending release Oct 30, 2023
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`). The `git 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 from `npx changeset tag` doesn't contain the string `"New tag:"`. The action should just finish successfully with nothing to left do.

Fixes #184
@1000hz 1000hz force-pushed the cina/184-skip-release-if-tags-exist branch from ec0014c to 2b7ed13 Compare October 31, 2023 15:21
@1000hz 1000hz merged commit 65996a5 into main Oct 31, 2023
3 checks passed
@1000hz 1000hz deleted the cina/184-skip-release-if-tags-exist branch October 31, 2023 16:04
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.

Release job should not report an error when no release is expected
2 participants