mirror of
https://github.com/tj-actions/branch-names.git
synced 2024-11-23 20:03:52 +08:00
Exclude current branch output for tag branches
This commit is contained in:
parent
1f12f147bf
commit
0b349276a0
@ -32,7 +32,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- id: branch
|
- id: branch
|
||||||
run: |
|
run: |
|
||||||
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||||
export BASE_REF=${{ github.base_ref }}
|
export BASE_REF=${{ github.base_ref }}
|
||||||
export HEAD_REF=${{ github.head_ref }}
|
export HEAD_REF=${{ github.head_ref }}
|
||||||
export REF=${{ github.ref }}
|
export REF=${{ github.ref }}
|
||||||
@ -44,7 +44,7 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- id: current_branch
|
- id: current_branch
|
||||||
run: |
|
run: |
|
||||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
if [[ ${{ github.event_name }} == 'pull_request' && "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
echo "::set-output name=current_branch::${{ steps.branch.outputs.head_ref_branch }}"
|
||||||
else
|
else
|
||||||
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
|
echo "::set-output name=current_branch::${{ steps.branch.outputs.ref_branch }}"
|
||||||
@ -52,7 +52,7 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
- id: default
|
- id: default
|
||||||
run: |
|
run: |
|
||||||
if [[ ! "${{ github.ref }}" == "refs/tags/"* ]]; then
|
if [[ "${{ github.ref }}" != "refs/tags/"* ]]; then
|
||||||
if [[ "${{ steps.current_branch.outputs.current_branch }}" == "${{ steps.branch.outputs.ref_branch }}" ]]; 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=is_default::true"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user