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
592194ab12
commit
dcd6890824
29
action.yml
29
action.yml
@ -31,19 +31,24 @@ outputs:
|
|||||||
ref_branch:
|
ref_branch:
|
||||||
value: ${{ steps.branch.outputs.ref_branch }}
|
value: ${{ steps.branch.outputs.ref_branch }}
|
||||||
description: 'The branch that triggered the workflow run.'
|
description: 'The branch that triggered the workflow run.'
|
||||||
|
tag:
|
||||||
|
value: ${{ steps.branch.outputs.tag }}
|
||||||
|
description: 'The tag that triggered the workflow run.'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- id: branch
|
- id: branch
|
||||||
run: |
|
run: |
|
||||||
export BASE_REF=${{ inputs.base_ref }}
|
if [[ !${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
|
||||||
export HEAD_REF=${{ inputs.head_ref }}
|
export BASE_REF=${{ inputs.base_ref }}
|
||||||
export REF=${{ inputs.ref }}
|
export HEAD_REF=${{ inputs.head_ref }}
|
||||||
echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"
|
export REF=${{ inputs.ref }}
|
||||||
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
|
echo "::set-output name=base_ref_branch::${BASE_REF/refs\/heads\//}"
|
||||||
REF_BRANCH=${REF/refs\/pull\//}
|
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
|
||||||
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
|
REF_BRANCH=${REF/refs\/pull\//}
|
||||||
|
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
|
||||||
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
- id: current_branch
|
- id: current_branch
|
||||||
run: |
|
run: |
|
||||||
@ -60,7 +65,15 @@ runs:
|
|||||||
else
|
else
|
||||||
echo "::set-output name=is_default::false"
|
echo "::set-output name=is_default::false"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
shell: bash
|
||||||
|
- id: tag
|
||||||
|
run: |
|
||||||
|
if [[ ${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
|
||||||
|
export REF=${{ inputs.ref }}
|
||||||
|
TAG=${REF/refs\/tags\//}
|
||||||
|
echo "::set-output name=tag::$TAG"
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: git-branch
|
icon: git-branch
|
||||||
|
Loading…
x
Reference in New Issue
Block a user