diff --git a/action.yml b/action.yml index 335f5c4..cea5eb4 100644 --- a/action.yml +++ b/action.yml @@ -16,6 +16,9 @@ inputs: required: false outputs: + is_default: + value: ${{ steps.current_branch.outputs.is_default }} + description: 'Returns "true" if the current branch is the default else "false".' 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).' @@ -50,6 +53,13 @@ runs: echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}" fi shell: bash + - id: is_default + run: | + if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.current_branch.outputs.base_ref_branch }}" ]]; then + echo "::set-output name=is_default::true" + else + echo "::set-output name=is_default::false" + fi branding: icon: git-branch