feat: add support for the default_branch output

Fixes: #124
This commit is contained in:
Tonye Jack 2022-03-22 16:35:08 -04:00 committed by GitHub
parent 4b89c81519
commit e1eabf0536
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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).'
@ -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