Merge pull request #77 from fkrafi/feature/custom_preid_support_#76
#76: added support for custom preid
This commit is contained in:
commit
ebd099e22a
11
README.md
11
README.md
|
@ -54,6 +54,17 @@ Make sure you use the `actions/checkout@v2` action!
|
||||||
default: prerelease
|
default: prerelease
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**preid:** Set a preid value will building prerelease version (optional - defaults to 'rc'). Example:
|
||||||
|
```yaml
|
||||||
|
- name: 'Automated Version Bump'
|
||||||
|
uses: 'phips28/gh-action-bump-version@master'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
default: prerelease
|
||||||
|
preid: 'prc'
|
||||||
|
```
|
||||||
|
|
||||||
**wording:** Customize the messages that trigger the version bump. It must be a string, case sensitive, coma separated (optional). Example:
|
**wording:** Customize the messages that trigger the version bump. It must be a string, case sensitive, coma separated (optional). Example:
|
||||||
```yaml
|
```yaml
|
||||||
- name: 'Automated Version Bump'
|
- name: 'Automated Version Bump'
|
||||||
|
|
|
@ -39,6 +39,10 @@ inputs:
|
||||||
description: 'Set a default version bump to use'
|
description: 'Set a default version bump to use'
|
||||||
default: 'patch'
|
default: 'patch'
|
||||||
required: false
|
required: false
|
||||||
|
preid:
|
||||||
|
description: 'Set a custom preid for prerelease build'
|
||||||
|
default: 'rc'
|
||||||
|
required: false
|
||||||
commit-message:
|
commit-message:
|
||||||
description: 'Set a custom commit message for version bump commit'
|
description: 'Set a custom commit message for version bump commit'
|
||||||
default: ''
|
default: ''
|
||||||
|
|
2
index.js
2
index.js
|
@ -52,7 +52,7 @@ Toolkit.run(async tools => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))) {
|
))) {
|
||||||
const preid = foundWord.split('-')[1]
|
const preid = process.env.INPUT_PREID || foundWord.split('-')[1]
|
||||||
version = `prerelease --preid=${preid}`
|
version = `prerelease --preid=${preid}`
|
||||||
} else if (Array.isArray(patchWords) && patchWords.length) {
|
} else if (Array.isArray(patchWords) && patchWords.length) {
|
||||||
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
|
if (!messages.some(message => patchWords.some(word => message.includes(word)))) {
|
||||||
|
|
Loading…
Reference in New Issue