Skip to content

Commit

Permalink
feat: add support for the default_branch output
Browse files Browse the repository at this point in the history
Fixes: #124
  • Loading branch information
jackton1 committed Mar 22, 2022
1 parent 4b89c81 commit e1eabf0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ outputs:
is_tag:
value: ${{ steps.tag.outputs.is_tag }}
description: 'Returns "true" if the current branch is a tag else "false".'
default_branch:
value: ${{ steps.default.outputs.default_branch }}
current_branch:
value: ${{ steps.current_branch.outputs.current_branch }}
description: 'Returns the value of the current branch which is consistent regardless of event_type: i.e (push, pull_requests).'
Expand Down Expand Up @@ -72,8 +74,10 @@ runs:
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"
echo "::set-output name=default_branch::${{ github.event.repository.default_branch }}"
else
echo "::set-output name=is_default::false"
echo "::set-output name=default_branch::${{ github.event.repository.default_branch }}"
fi
fi
shell: bash
Expand Down

0 comments on commit e1eabf0

Please sign in to comment.