-
Notifications
You must be signed in to change notification settings - Fork 4
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
Introduce version increment validation #50
Conversation
|
@@ -4,6 +4,7 @@ on: | |||
pull_request: | |||
paths-ignore: | |||
- "**.md" | |||
- "!.changeset/**" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not ignore changesets!
if [ ! -s "$OUTPUT" ]; then | ||
echo "Error: Temporary file is empty after running 'yarn changeset status'" | ||
exit 1 | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that part has been extracted to .github/actions/changeset-status/action.yml
for convenient use in both checks
and build
jobs
|
||
# creates a PR if there are changesets or assign the new tag if the PR is merged | ||
- name: Create Release Pull Request or Publish | ||
id: changesets | ||
if: steps.release-details.outputs.message | ||
# runs only when the changeset's base_branch is the target branch | ||
if: steps.changeset-status.outputs.base_branch == '${{ github.ref_name }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from the removed Determine Release Details
step
* Verify the version bump against the base branch (#45) * Add patch (#49) * Add second patch * 🚀 Release `[email protected] → 0.2.2` (#50) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add patch * 🚀 Release `[email protected] → 0.2.30` (#51) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Use publihsedPackages for tagged_release * Reset source changes * Add comments about fetch-depth: 0 --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
It modifies the GH workflows to verify that a PR does not include unwanted changesets based on the
baseBranch
field in the.changeset/config.json
file:patch
changesets are allowed forv[0-9]+.x.x
branchespath
andminor
changesets are allowed forv[0-9]+.[0-9]+.x
branchesExamples:
v1.0.x
must stay within patch range and should never release1.1.0
version because that version might be already released before or will be released from more appropriate commit.v10.x.x
must stay within minor range and should never releasev11.0.0
version.