Skip to content

Commit 0aec0cb

Browse files
committed
chore(ci): Publish - fail when unable to detect branch
1 parent 1c44cdb commit 0aec0cb

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ jobs:
784784
})
785785
786786
detect_branch:
787-
runs-on: ubuntu-20.04
787+
runs-on: ubuntu-24.04
788788
outputs:
789789
is_master: ${{ steps.detect_branch.outputs.is_master }}
790790
branch: ${{ steps.detect_branch.outputs.branch }}
@@ -794,12 +794,18 @@ jobs:
794794
- name: Detect branch name
795795
id: detect_branch
796796
env:
797-
EVENT_BASE_REF: ${{ github.event.base_ref || 'master' }}
797+
EVENT_BASE_REF: ${{ github.event.base_ref || 'tag_on_unknown_branch_commit_not_pushed' }}
798798
run: |
799799
BRANCH=${EVENT_BASE_REF#refs/heads/}
800-
echo "Detected branch: $BRANCH"
801800
801+
if [ "$BRANCH" == "tag_on_unknown_branch_commit_not_pushed" ]; then
802+
echo "Error: Could not detect branch name. Most likely this is that commit for tag is not pushed yet."
803+
exit 1
804+
fi
805+
806+
echo "Detected branch: $BRANCH"
802807
IS_MASTER=false
808+
803809
if [ "$BRANCH" == "master" ]; then
804810
IS_MASTER=true
805811
fi

0 commit comments

Comments
 (0)