Skip to content

Commit

Permalink
Merge pull request #32 from tj-actions/update-if-block
Browse files Browse the repository at this point in the history
Update action.yml
  • Loading branch information
jackton1 committed Apr 25, 2021
2 parents b587231 + 0960d86 commit ebe618e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
steps:
- id: branch
run: |
if [[ !${{ startsWith(github.ref, 'refs/tags/') }} ]]; then
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
export BASE_REF=${{ github.base_ref }}
export HEAD_REF=${{ github.head_ref }}
export REF=${{ github.ref }}
Expand All @@ -52,15 +52,17 @@ runs:
shell: bash
- id: default
run: |
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" && !${{ startsWith(github.ref, 'refs/tags/') }} ]]; then
echo "::set-output name=is_default::true"
else
echo "::set-output name=is_default::false"
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" ]]; then
echo "::set-output name=is_default::true"
else
echo "::set-output name=is_default::false"
fi
fi
shell: bash
- id: tag
run: |
if [[ ${{ startsWith(github.ref, 'refs/tags/') }} ]]; then
if [[ "${{ github.ref }}" == "refs/tags/"* ]]; then
export REF=${{ github.ref }}
TAG=${REF/refs\/tags\${{ inputs.strip_tag_prefix }}//}
echo "::set-output name=tag::$TAG"
Expand Down

0 comments on commit ebe618e

Please sign in to comment.