Merge pull request #32 from tj-actions/update-if-block

Update action.yml
This commit is contained in:
Tonye Jack 2021-04-24 21:16:59 -04:00 committed by GitHub
commit ebe618e79a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ runs:
steps: steps:
- id: branch - id: branch
run: | run: |
if [[ !${{ startsWith(github.ref, 'refs/tags/') }} ]]; then if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
export BASE_REF=${{ github.base_ref }} export BASE_REF=${{ github.base_ref }}
export HEAD_REF=${{ github.head_ref }} export HEAD_REF=${{ github.head_ref }}
export REF=${{ github.ref }} export REF=${{ github.ref }}
@ -52,15 +52,17 @@ runs:
shell: bash shell: bash
- id: default - id: default
run: | run: |
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" && !${{ startsWith(github.ref, 'refs/tags/') }} ]]; then if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
echo "::set-output name=is_default::true" if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" ]]; then
else echo "::set-output name=is_default::true"
echo "::set-output name=is_default::false" else
echo "::set-output name=is_default::false"
fi
fi fi
shell: bash shell: bash
- id: tag - id: tag
run: | run: |
if [[ ${{ startsWith(github.ref, 'refs/tags/') }} ]]; then if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
export REF=${{ github.ref }} export REF=${{ github.ref }}
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"