We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70c9dc5 commit 42697faCopy full SHA for 42697fa
entrypoint.sh
@@ -1,6 +1,6 @@
1
#!/usr/bin/env bash
2
3
-set -e
+set -euo pipefail
4
5
if [[ $GITHUB_REF != "refs/tags/"* ]]; then
6
echo "::warning::Skipping: This should only run on tags push or on release instead of '$GITHUB_EVENT_NAME'.";
@@ -9,8 +9,12 @@ fi
9
10
git fetch origin +refs/tags/*:refs/tags/*
11
12
-CURRENT_TAG=${3:-$(git describe --abbrev=0 --tags "$(git rev-list --tags --skip=1 --max-count=1)" 2>/dev/null || true)}
13
NEW_TAG=${4:-"${GITHUB_REF/refs\/tags\//}"}
+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
18
19
if [[ -z $CURRENT_TAG ]]; then
20
echo "::warning::Initial release detected unable to determine any tag diff."
0 commit comments