Skip to content

Commit

Permalink
ci: fix branch check
Browse files Browse the repository at this point in the history
  • Loading branch information
chanshing committed Jul 24, 2024
1 parent f1c1a31 commit 1cd58b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:

- name: Check branch for tag
run: |
BRANCH_NAME=$(git branch --contains ${{ github.ref }} | grep -E 'main|master' | xargs)
BRANCH_NAME=$(git branch --contains ${{ github.ref }} | sed 's/^[* ]*//' | grep -E 'main|master' | xargs)
echo ${{ github.ref }}
echo "$BRANCH_NAME"
if [[ -z "$BRANCH_NAME" ]]; then
echo "##[error]Tag is not in main or master branch."
exit 1
Expand Down

0 comments on commit 1cd58b8

Please sign in to comment.