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

Upgrade to node20 + Support for choosing prepatch, preminor and premajor version types #235

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.nyc_output
/test-repo
/.env
/.env
.idea
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Automated Version Bump
description: Automated version bump for npm packages.
runs:
using: node16
using: node20
main: index.js
branding:
icon: chevron-up
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const pkg = getPackageJson();
console.log("Couldn't find any commits in this event, incrementing patch version...");
}

const allowedTypes = ['major', 'minor', 'patch', 'prerelease'];
const allowedTypes = ['major', 'minor', 'patch', 'premajor', 'preminor', 'prepatch', 'prerelease'];
if (process.env['INPUT_VERSION-TYPE'] && !allowedTypes.includes(process.env['INPUT_VERSION-TYPE'])) {
exitFailure('Invalid version type');
return;
Expand Down Expand Up @@ -145,7 +145,7 @@ const pkg = getPackageJson();
}

// case: if default=prerelease, but rc-wording is NOT set
if (version === 'prerelease' && preid) {
if (['prerelease', 'prepatch', 'preminor', 'premajor'].includes(version) && preid) {
version = `${version} --preid=${preid}`;
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gh-action-bump-version",
"version": "10.1.2",
"version": "10.2.0",
"repository": {
"type": "git",
"url": "git+https://github.com/phips28/gh-action-bump-version.git"
Expand Down