Skip to content

Commit a970082

Browse files
committed
TAG_PREFIX takes priority from WITH_V
1 parent 3acdde7 commit a970082

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
3939
env:
4040
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
41-
WITH_V: false
4241
```
4342
4443
```yaml
@@ -67,7 +66,7 @@ jobs:
6766
uses: anothrNick/github-tag-action@v1 # Don't use @master or @v1 unless you're happy to test the latest version
6867
env:
6968
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
70-
WITH_V: true
69+
TAG_PREFIX: v
7170
PRERELEASE: true
7271

7372
```
@@ -93,7 +92,7 @@ _NOTE: set the fetch-depth for `actions/checkout@v2` or newer to be sure you ret
9392
- **GIT_API_TAGGING** _(optional)_ - Set if using git cli or git api calls for tag push operations. Possible values are `false` and `true` (default).
9493
- **INITIAL_VERSION** _(optional)_ - Set initial version before bump. Default `0.0.0`. MAKE SURE NOT TO USE vX.X.X here if combined TAG_PREFIX
9594
- **TAG_CONTEXT** _(optional)_ - Set the context of the previous tag. Possible values are `repo` (default) or `branch`.
96-
- **TAG_PREFIX** _(optional)_ - Prefix to add to the tag. eg `v` to create `v0.0.0`, WITH_V takes precidance for backwards compatibility
95+
- **TAG_PREFIX** _(optional)_ - Prefix to add to the tag. eg `v` to create `v0.0.0`. This takes precidance over WITH_V
9796
- **PRERELEASE** _(optional)_ - Define if workflow runs in prerelease mode, `false` by default. Note this will be overwritten if using complex suffix release branches. Use it with checkout `ref: ${{ github.sha }}` for consistency see [issue 266](https://github.com/anothrNick/github-tag-action/issues/266).
9897
- **PRERELEASE_SUFFIX** _(optional)_ - Suffix for your prerelease versions, `beta` by default. Note this will only be used if a prerelease branch.
9998
- **VERBOSE** _(optional)_ - Print git logs. For some projects these logs may be very large. Possible values are `true` (default) and `false`.

entrypoint.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,15 @@ git fetch --tags
8787
# Set no tag prefix (not even v)
8888
tagPrefix=""
8989

90-
# If a tag_prefix is supplied use that
91-
if [[ "${tag_prefix}" != "false" ]]
90+
if $with_v
9291
then
93-
tagPrefix=$tag_prefix
92+
tagPrefix="v"
9493
fi
9594

96-
# with_v superseeds tag_prefix
97-
if $with_v
95+
# If a tag_prefix is supplied use that
96+
if [[ "${tag_prefix}" != "false" ]]
9897
then
99-
tagPrefix="v"
98+
tagPrefix=$tag_prefix
10099
fi
101100

102101
tagFmt="^$tagPrefix?[0-9]+\.[0-9]+\.[0-9]+$"

0 commit comments

Comments
 (0)