From 4f331933ddcd972428053cd4d1c3f37787c92657 Mon Sep 17 00:00:00 2001 From: Nahue Date: Thu, 1 Feb 2024 16:15:23 -0300 Subject: [PATCH] Feat: Upgrade to node20 + Support for choosing prepatch, preminor and 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 Co-authored-by: Phil --- .gitignore | 3 ++- action.yml | 2 +- index.js | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 58635a4e4..5269789fa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules .nyc_output /test-repo -/.env \ No newline at end of file +/.env +.idea \ No newline at end of file diff --git a/action.yml b/action.yml index 58d47bab0..1be3d3986 100644 --- a/action.yml +++ b/action.yml @@ -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 diff --git a/index.js b/index.js index fd8be94d0..232f23143 100644 --- a/index.js +++ b/index.js @@ -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; @@ -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}`; } diff --git a/package-lock.json b/package-lock.json index 2d1eb5961..5350c391f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gh-action-bump-version", - "version": "10.1.2", + "version": "10.2.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "gh-action-bump-version", - "version": "10.1.2", + "version": "10.2.0", "license": "ISC", "devDependencies": { "@types/jest": "^27.0.1", diff --git a/package.json b/package.json index c1b4e572c..7b6aa0ddd 100644 --- a/package.json +++ b/package.json @@ -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"