Skip to content

Commit 49cca0a

Browse files
committed
Fix publish workflow: skip tag creation if already exists
1 parent 8191b7e commit 49cca0a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/publish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@ jobs:
9898
run: |
9999
git config user.name "github-actions"
100100
git config user.email "github-actions@github.com"
101-
git tag -a "v$TAG_VERSION" -m "v$TAG_VERSION"
102-
git push origin "v$TAG_VERSION"
101+
git fetch --tags
102+
if git rev-parse "v$TAG_VERSION" >/dev/null 2>&1; then
103+
echo "Tag v$TAG_VERSION already exists, skipping"
104+
else
105+
git tag -a "v$TAG_VERSION" -m "v$TAG_VERSION"
106+
git push origin "v$TAG_VERSION"
107+
fi
103108
env:
104109
TAG_VERSION: ${{ steps.version.outputs.version }}
105110

0 commit comments

Comments
 (0)