Skip to content

Commit

Permalink
Merge pull request #14 from PeerXu/with-v
Browse files Browse the repository at this point in the history
bump version with `v` character
  • Loading branch information
anothrNick authored Sep 26, 2019
2 parents 63fe95a + 882b4a9 commit 3fb9e87
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
* **GITHUB_TOKEN** ***(required)*** - Required for permission to tag the repo.
* **REPO_OWNER** ***(required)*** - Required to target the repo to tag.
* **DEFAULT_BUMP** *(optional)* - Which type of bump to use when none explicitly provided (default: `minor`).
* **WITH_V** *(optional)* - Tag version with `v` character.

> ***Note:*** This action creates a [lightweight tag](https://developer.github.com/v3/git/refs/#create-a-reference).
Expand Down
6 changes: 6 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# config
default_semvar_bump=${DEFAULT_BUMP:-minor}
with_v=${WITH_V:-false}

# get latest tag
tag=$(git describe --tags `git rev-list --tags --max-count=1`)
Expand Down Expand Up @@ -33,6 +34,11 @@ case "$log" in
* ) new=$(semver bump `echo $default_semvar_bump` $tag);;
esac

if $with_v
then
new="v$new"
fi

echo $new

dt=$(date '+%Y-%m-%dT%H:%M:%SZ')
Expand Down

0 comments on commit 3fb9e87

Please sign in to comment.