Added support for stripping tag prefix

This commit is contained in:
Tonye Jack 2021-04-24 20:07:39 -04:00 committed by GitHub
parent 8a263a0bad
commit 5a0bb26204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,6 +14,10 @@ inputs:
description: 'The branch that triggered the workflow run.'
default: ${{ github.ref }}
required: false
strip_tag_prefix:
description: 'The tag prefix to strip i.e v0.0.1 -> (strip v) -> 0.0.1'
default: ''
required: false
outputs:
is_default:
@ -70,7 +74,7 @@ runs:
run: |
if [[ ${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
export REF=${{ inputs.ref }}
TAG=${REF/refs\/tags\//}
TAG=$(echo "${REF/refs\/tags\//}" | sed 's/${{ inputs.strip_tag_prefix }}//')
echo "::set-output name=tag::$TAG"
fi
shell: bash