mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-12-27 14:27:59 +08:00
Update action.yml
This commit is contained in:
parent
a9ebb75435
commit
653ab74a8a
14
action.yml
14
action.yml
@ -44,10 +44,16 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- id: current_branch
|
- id: current_branch
|
||||||
run: |
|
run: |
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' && "${{ github.ref }}" != "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
||||||
|
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
||||||
|
else
|
||||||
|
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
|
REF=${{ github.ref }}
|
||||||
|
REF_BRANCH=${REF/refs\/tags\//}
|
||||||
|
echo "::set-output name=current_branch::$REF_BRANCH"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
- id: default
|
- id: default
|
||||||
@ -64,8 +70,6 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
|
||||||
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