mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-24 01:13:51 +08:00
Merge pull request #25 from tj-actions/add-support-for-stripping-tag-prefix
Added support for stripping tag prefix
This commit is contained in:
commit
ae7cf1163a
@ -14,6 +14,10 @@ inputs:
|
|||||||
description: 'The branch that triggered the workflow run.'
|
description: 'The branch that triggered the workflow run.'
|
||||||
default: ${{ github.ref }}
|
default: ${{ github.ref }}
|
||||||
required: false
|
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:
|
outputs:
|
||||||
is_default:
|
is_default:
|
||||||
@ -70,7 +74,7 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
if [[ ${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
|
if [[ ${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
|
||||||
export REF=${{ inputs.ref }}
|
export REF=${{ inputs.ref }}
|
||||||
TAG=${REF/refs\/tags\//}
|
TAG=${REF/refs\/tags\${{ inputs.strip_tag_prefix }}//}
|
||||||
echo "::set-output name=tag::$TAG"
|
echo "::set-output name=tag::$TAG"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
Loading…
Reference in New Issue
Block a user