Skip to content

Commit 096bd39

Browse files
committed
Fix branch name and add workflow dispatch
1 parent 880f380 commit 096bd39

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/build-and-push.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ jobs:
4646
else
4747
FULL_SHA="${{ github.sha }}"
4848
SHORT_SHA="${FULL_SHA:0:7}"
49-
BRANCH_NAME="${{ github.ref_name }}"
49+
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
50+
BRANCH_NAME="${{ github.head_ref }}"
51+
else
52+
BRANCH_NAME="${{ github.ref_name }}"
53+
fi
5054
BRANCH_NAME="${BRANCH_NAME//\//-}"
5155
echo "tags=${BRANCH_NAME},${FULL_SHA},${SHORT_SHA}" >> $GITHUB_OUTPUT
5256
fi

0 commit comments

Comments
 (0)