Skip to content

Commit 17f8160

Browse files
committed
fix(release): skip release without version bump
1 parent 9faec45 commit 17f8160

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,12 @@ jobs:
139139
FILE="src/sqlitejs.h"
140140
VERSION=$(grep -oP '#define SQLITE_JS_VERSION\s+"\K[^"]+' "$FILE")
141141
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
142-
echo "version=$VERSION" >> $GITHUB_OUTPUT
142+
LATEST=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.name')
143+
if [[ "$VERSION" != "$LATEST" ]]; then
144+
echo "version=$VERSION" >> $GITHUB_OUTPUT
145+
else
146+
echo "::warning file=src/sqlitejs.h::To release a new version, please update the SQLITE_JS_VERSION in src/sqlitejs.h to be different than the latest $LATEST"
147+
fi
143148
exit 0
144149
fi
145150
echo "❌ SQLITE_JS_VERSION not found in sqlitejs.h"
@@ -157,6 +162,7 @@ jobs:
157162
done
158163
159164
- uses: softprops/[email protected]
165+
if: steps.tag.outputs.version != ''
160166
with:
161167
generate_release_notes: true
162168
tag_name: ${{ steps.tag.outputs.version }}

0 commit comments

Comments
 (0)