Skip to content

Commit 1d893f3

Browse files
committed
Fix publish logic to check git tags instead of commit message
1 parent 1ecb5e4 commit 1d893f3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,12 @@ jobs:
292292
- name: Publish
293293
run: |
294294
npm config set provenance true
295-
if git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+$";
295+
if git describe --exact-match --tags HEAD 2>/dev/null | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$";
296296
then
297297
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
298298
npm publish --access public
299-
elif git log -1 --pretty=%B | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+";
300-
then
301-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
302-
npm publish --tag next --access public
303299
else
304-
echo "Not a release, skipping publish"
300+
echo "Not a release tag, skipping publish"
305301
fi
306302
env:
307303
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)