ci(actions): Auto update tag for patch build (#3387)

Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
Rajesh Rajendran 2025-05-12 15:54:10 +02:00 committed by GitHub
parent b2e961d621
commit 80ffa15959
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,20 +27,11 @@ jobs:
"https://api.github.com/repos/${{ github.repository }}/releases/latest" \ "https://api.github.com/repos/${{ github.repository }}/releases/latest" \
| jq -r .tag_name) | jq -r .tag_name)
GIT_LATEST_TAG=$(git tag --list 'v[0-9]*' --sort=-v:refname | head -n 1)
# Fallback to git command if API doesn't return a tag # Fallback to git command if API doesn't return a tag
if [ "$LATEST_TAG" == "null" ] || [ -z "$LATEST_TAG" ]; then if [ "$LATEST_TAG" == "null" ] || [ -z "$LATEST_TAG" ]; then
echo "Not found latest tag" echo "Not found latest tag"
exit 100 exit 100
fi fi
if [ "$GIT_LATEST_TAG" == "null" ] || [ -z "$GIT_LATEST_TAG" ]; then
echo "Not found git latest tag"
exit 100
fi
if [ "$GIT_LATEST_TAG" != "$LATEST_TAG" ]; then
echo "Latest tag in git repo doesn't match latest tag in GitHub. Exiting."
exit 100
fi
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
echo "Latest tag: $LATEST_TAG" echo "Latest tag: $LATEST_TAG"