Skip to content

Commit 42697fa

Browse files
authored
Update entrypoint.sh
1 parent 70c9dc5 commit 42697fa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

entrypoint.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -e
3+
set -euo pipefail
44

55
if [[ $GITHUB_REF != "refs/tags/"* ]]; then
66
echo "::warning::Skipping: This should only run on tags push or on release instead of '$GITHUB_EVENT_NAME'.";
@@ -9,8 +9,12 @@ fi
99

1010
git fetch origin +refs/tags/*:refs/tags/*
1111

12-
CURRENT_TAG=${3:-$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)" 2>/dev/null || true)}
1312
NEW_TAG=${4:-"${GITHUB_REF/refs\/tags\//}"}
13+
MAJOR_VERSION=$(echo "$NEW_TAG" | cut -d. -f1)
14+
15+
16+
CURRENT_TAG=${3:-$(git tag -l --sort=-version:refname "$MAJOR_VERSION.*" | grep -v "$NEW_TAG" | head -1 || true)}
17+
1418

1519
if [[ -z $CURRENT_TAG ]]; then
1620
echo "::warning::Initial release detected unable to determine any tag diff."

0 commit comments

Comments
 (0)