Skip to content

Commit

Permalink
Feat: Upgrade to node20 + Support for choosing prepatch, preminor and…
Browse files Browse the repository at this point in the history
… premajor version types (#235)

* Addded support for prepatch, preminor, premajor

* Addded support for prepatch, preminor, premajor

* 10.1.2

* Addded support for prepatch, preminor, premajor

* 10.1.3

* Addded support for prepatch, preminor, premajor

* 10.1.4

* Move to node20

* Move to node20

* Move to node20

---------

Co-authored-by: Nahuel Sotelo <nsotelo@dlocal.com>
Co-authored-by: Phil <phips28@gmx.at>
  • Loading branch information
3 people committed Feb 1, 2024
1 parent 9e54cbc commit 4f33193
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
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

0 comments on commit 4f33193

Please sign in to comment.