From 223bf2a2d9d64bda1294b2e5a0b5d18c909dc71f Mon Sep 17 00:00:00 2001 From: Md Fasihul Kabir Date: Tue, 9 Mar 2021 17:34:54 +0600 Subject: [PATCH] #76: added support for custom preid --- README.md | 11 +++++++++++ action.yml | 4 ++++ index.js | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6da41fb..4ce56c6 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,17 @@ Make sure you use the `actions/checkout@v2` action! 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: ```yaml - name: 'Automated Version Bump' diff --git a/action.yml b/action.yml index 26e5d6c..8fcfca2 100644 --- a/action.yml +++ b/action.yml @@ -39,6 +39,10 @@ inputs: description: 'Set a default version bump to use' default: 'patch' required: false + preid: + description: 'Set a custom preid for prerelease build' + default: 'rc' + required: false commit-message: description: 'Set a custom commit message for version bump commit' default: '' diff --git a/index.js b/index.js index 42dc22b..eac350e 100644 --- a/index.js +++ b/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}` } else if (Array.isArray(patchWords) && patchWords.length) { if (!messages.some(message => patchWords.some(word => message.includes(word)))) {