mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-23 20:23:50 +08:00
Update action.yml
This commit is contained in:
parent
d521565461
commit
39b955e7b1
10
action.yml
10
action.yml
@ -20,6 +20,9 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
|
|
||||||
outputs:
|
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:
|
base_ref_branch:
|
||||||
value: ${{ steps.branch.outputs.base_ref_branch }}
|
value: ${{ steps.branch.outputs.base_ref_branch }}
|
||||||
description: 'The target branch of a pull request'
|
description: 'The target branch of a pull request'
|
||||||
@ -43,6 +46,13 @@ runs:
|
|||||||
REF_BRANCH=${REF/refs\/pull\//}
|
REF_BRANCH=${REF/refs\/pull\//}
|
||||||
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
|
echo "::set-output name=ref_branch::${REF_BRANCH/refs\/heads\//}"
|
||||||
shell: bash
|
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:
|
branding:
|
||||||
icon: git-branch
|
icon: git-branch
|
||||||
color: white
|
color: white
|
||||||
|
Loading…
Reference in New Issue
Block a user