Skip to content

Commit eccc126

Browse files
Copilotfriggeri
andcommitted
Add error handling for Go submodule tag creation
Co-authored-by: friggeri <106686+friggeri@users.noreply.github.com>
1 parent 1a92573 commit eccc126

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/publish.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,13 @@ jobs:
209209
run: |
210210
git config user.name "github-actions[bot]"
211211
git config user.email "github-actions[bot]@users.noreply.github.com"
212-
git tag "go/v${{ needs.version.outputs.version }}"
213-
git push origin "go/v${{ needs.version.outputs.version }}"
212+
TAG_NAME="go/v${{ needs.version.outputs.version }}"
213+
if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
214+
echo "Tag $TAG_NAME already exists, skipping"
215+
else
216+
git tag "$TAG_NAME"
217+
git push origin "$TAG_NAME"
218+
echo "Created and pushed tag $TAG_NAME"
219+
fi
214220
env:
215221
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)