Skip to content

Commit 4a271c5

Browse files
committed
chore: Update release workflow to ensure tags are created and pushed only if they do not already exist
1 parent 7654e1a commit 4a271c5

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/release-tags.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66
- main
77

88
permissions:
9+
actions: write
910
contents: write
1011

1112
jobs:
@@ -54,11 +55,11 @@ jobs:
5455
tag="${package}@v${current}"
5556
if git ls-remote --tags origin "refs/tags/$tag" | grep -q "$tag"; then
5657
echo "Tag $tag already exists"
57-
continue
58+
else
59+
git tag "$tag"
60+
git push origin "$tag"
5861
fi
5962
60-
git tag "$tag"
61-
git push origin "$tag"
6263
gh workflow run release.yml --ref main -f tag="$tag"
6364
done
6465
env:

0 commit comments

Comments
 (0)