Update action.yml

This commit is contained in:
Tonye Jack 2021-02-07 19:30:56 -05:00 committed by GitHub
parent d521565461
commit 39b955e7b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,9 @@ inputs:
required: false
outputs:
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).'
base_ref_branch:
value: ${{ steps.branch.outputs.base_ref_branch }}
description: 'The target branch of a pull request'
@ -43,6 +46,13 @@ runs:
REF_BRANCH=${REF/refs\/pull\//}
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
shell: bash
- id: current_branch
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
else
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
fi
branding:
icon: git-branch
color: white