From 882b4a9bfbac6fd307d52c5ba7a77f59c8667d99 Mon Sep 17 00:00:00 2001 From: Peer Xu Date: Thu, 26 Sep 2019 13:30:54 +0800 Subject: [PATCH] bump version with `v` character --- README.md | 1 + entrypoint.sh | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 88f86601..971ce004 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/entrypoint.sh b/entrypoint.sh index f067277a..165cfdfd 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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`) @@ -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')