Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -791,16 +791,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect branch name
id: detect_branch
env:
EVENT_BASE_REF: ${{ github.event.base_ref || 'tag_on_unknown_branch_commit_not_pushed' }}
run: |
BRANCH=${EVENT_BASE_REF#refs/heads/}
GIT_BRANCHES=$(git branch -r --contains ${{ github.ref_name }})
echo "Git contains: $GIT_BRANCHES"

BRANCH="$(echo "${GIT_BRANCHES//origin\//}" | tr -d '\n')"

if [ "$BRANCH" == "tag_on_unknown_branch_commit_not_pushed" ]; then
echo "Error: Could not detect branch name. Most likely this is that commit for tag is not pushed yet."
exit 1
if [[ -z "$BRANCH" ]]; then
echo "Error: Could not detect branch name. Most likely this is that commit for tag is not pushed yet."
exit 1
fi

echo "Detected branch: $BRANCH"
Expand Down