mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-12-27 14:27:59 +08:00
parent
156e33c8e9
commit
a9ebb75435
10
action.yml
10
action.yml
@ -33,9 +33,9 @@ runs:
|
|||||||
- id: branch
|
- id: branch
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||||
export BASE_REF=${{ github.base_ref }}
|
BASE_REF=${{ github.base_ref }}
|
||||||
export HEAD_REF=${{ github.head_ref }}
|
HEAD_REF=${{ github.head_ref }}
|
||||||
export REF=${{ github.ref }}
|
REF=${{ github.ref }}
|
||||||
echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"
|
echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"
|
||||||
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
|
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
|
||||||
REF_BRANCH=${REF/refs\/pull\//}
|
REF_BRANCH=${REF/refs\/pull\//}
|
||||||
@ -63,7 +63,9 @@ runs:
|
|||||||
- id: tag
|
- id: tag
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||||
export REF=${{ github.ref }}
|
REF=${{ github.ref }}
|
||||||
|
REF_BRANCH=${REF/refs\/tags\//}
|
||||||
|
echo "::set-output name=current_branch::$REF_BRANCH"
|
||||||
TAG=${REF/refs\/tags\/${{ inputs.strip_tag_prefix }}/}
|
TAG=${REF/refs\/tags\/${{ inputs.strip_tag_prefix }}/}
|
||||||
echo "::set-output name=tag::$TAG"
|
echo "::set-output name=tag::$TAG"
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user