Skip to content

Commit

Permalink
Merge pull request #59 from dmerrick/adding-default-bump-none
Browse files Browse the repository at this point in the history
Adding support for DEFAULT_BUMP=none
  • Loading branch information
anothrNick committed May 5, 2020
2 parents 9d0290c + c6c4ce4 commit c170e78
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -59,7 +59,7 @@ _NOTE: set the fetch-depth for `actions/checkout@master` to be sure you retrieve

**Manual Bumping:** Any commit message that includes `#major`, `#minor`, or `#patch` will trigger the respective version bump. If two or more are present, the highest-ranking one will take precedence.

**Automatic Bumping:** If no `#major`, `#minor` or `#patch` tag is contained in the commit messages, it will bump whichever `DEFAULT_BUMP` is set to (which is `minor` by default).
**Automatic Bumping:** If no `#major`, `#minor` or `#patch` tag is contained in the commit messages, it will bump whichever `DEFAULT_BUMP` is set to (which is `minor` by default). Disable this by setting `DEFAULT_BUMP` to `none`.

> ***Note:*** This action **will not** bump the tag if the `HEAD` commit has already been tagged.
Expand Down
13 changes: 12 additions & 1 deletion entrypoint.sh
Expand Up @@ -51,13 +51,24 @@ fi

echo $log

# this will bump the semvar using the default bump level,
# or it will simply pass if the default was "none"
function default-bump {
if [ "$default_semvar_bump" == "none" ]; then
echo "Default bump was set to none. Skipping..."
exit 0
else
semver bump "${default_semvar_bump}" $tag
fi
}

# get commit logs and determine home to bump the version
# supports #major, #minor, #patch (anything else will be 'minor')
case "$log" in
*#major* ) new=$(semver bump major $tag); part="major";;
*#minor* ) new=$(semver bump minor $tag); part="minor";;
*#patch* ) new=$(semver bump patch $tag); part="patch";;
* ) new=$(semver bump `echo $default_semvar_bump` $tag); part=$default_semvar_bump;;
* ) new=$(default-bump); part=$default_semvar_bump;;
esac

echo $part
Expand Down

0 comments on commit c170e78

Please sign in to comment.