Update action.yml

This commit is contained in:
Tonye Jack 2021-04-24 06:35:28 -04:00 committed by GitHub
parent 592194ab12
commit dcd6890824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,12 +31,16 @@ outputs:
ref_branch:
value: ${{ steps.branch.outputs.ref_branch }}
description: 'The branch that triggered the workflow run.'
tag:
value: ${{ steps.branch.outputs.tag }}
description: 'The tag that triggered the workflow run.'
runs:
using: "composite"
steps:
- id: branch
run: |
if [[ !${{ startsWith(inputs.ref, 'refs/tags/') }} ]]; then
export BASE_REF=${{ inputs.base_ref }}
export HEAD_REF=${{ inputs.head_ref }}
export REF=${{ inputs.ref }}
@ -44,6 +48,7 @@ runs:
echo "::set-output name=head_ref_branch::${HEAD_REF/refs\/heads\//}"
REF_BRANCH=${REF/refs\/pull\//}
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
fi
shell: bash
- id: current_branch
run: |
@ -61,6 +66,14 @@ runs:
echo "::set-output name=is_default::false"
fi
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:
icon: git-branch