Merge pull request #47 from alehechka/master
Customizable RC and Patch wording to new bump versions
This commit is contained in:
commit
b67fbc3a70
|
@ -47,6 +47,9 @@ Make sure you use the `actions/checkout@v2` action!
|
||||||
with:
|
with:
|
||||||
minor-wording: 'add,Adds,new'
|
minor-wording: 'add,Adds,new'
|
||||||
major-wording: 'MAJOR,cut-major'
|
major-wording: 'MAJOR,cut-major'
|
||||||
|
patch-wording: 'patch,fixes' # Providing patch-wording will override commits
|
||||||
|
# defaulting to a patch bump.
|
||||||
|
rc-wording: 'RELEASE,alpha'
|
||||||
```
|
```
|
||||||
|
|
||||||
**PACKAGEJSON_DIR:** Param to parse the location of the desired package.json (optional). Example:
|
**PACKAGEJSON_DIR:** Param to parse the location of the desired package.json (optional). Example:
|
||||||
|
|
|
@ -18,6 +18,11 @@ inputs:
|
||||||
major-wording:
|
major-wording:
|
||||||
description: 'Words list that trigger a major version bump'
|
description: 'Words list that trigger a major version bump'
|
||||||
default: 'BREAKING CHANGE,major'
|
default: 'BREAKING CHANGE,major'
|
||||||
|
patch-wording:
|
||||||
|
description: 'Words list that trigger a patch version bump'
|
||||||
|
rc-wording:
|
||||||
|
description: 'Words list that trigger a patch version bump'
|
||||||
|
default: 'pre-alpha,pre-beta,pre-rc'
|
||||||
skip-tag:
|
skip-tag:
|
||||||
description: 'Avoid to add a TAG to the version update commit'
|
description: 'Avoid to add a TAG to the version update commit'
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
|
12
index.js
12
index.js
|
@ -28,7 +28,8 @@ Toolkit.run(async tools => {
|
||||||
|
|
||||||
const majorWords = process.env['INPUT_MAJOR-WORDING'].split(',')
|
const majorWords = process.env['INPUT_MAJOR-WORDING'].split(',')
|
||||||
const minorWords = process.env['INPUT_MINOR-WORDING'].split(',')
|
const minorWords = process.env['INPUT_MINOR-WORDING'].split(',')
|
||||||
const preReleaseWords = ['pre-alpha', 'pre-beta', 'pre-rc']
|
const patchWords = process.env['INPUT_PATCH-WORDING'].split(',')
|
||||||
|
const preReleaseWords = process.env['INPUT_RC-WORDING'].split(',')
|
||||||
|
|
||||||
let version = 'patch'
|
let version = 'patch'
|
||||||
let foundWord = null;
|
let foundWord = null;
|
||||||
|
@ -49,6 +50,15 @@ Toolkit.run(async tools => {
|
||||||
))) {
|
))) {
|
||||||
const preid = foundWord.split("-")[1];
|
const preid = foundWord.split("-")[1];
|
||||||
version = `prerelease --preid=${preid}`;
|
version = `prerelease --preid=${preid}`;
|
||||||
|
} else if (patchWords && Array.isArray(patchWords)) {
|
||||||
|
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
|
||||||
|
version = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version === null) {
|
||||||
|
tools.exit.success('No version keywords found, skipping bump.')
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue