File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed
Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -213,18 +213,12 @@ jobs:
213213 git config user.email "github-actions[bot]@users.noreply.github.com"
214214 git fetch --tags
215215 TAG_NAME="go/v${{ needs.version.outputs.version }}"
216- # Check if tag exists locally or remotely
217- if git rev-parse "$TAG_NAME" >/dev/null 2>&1 || git ls-remote --tags origin "refs/tags/$TAG_NAME" | grep -q "$TAG_NAME"; then
218- echo "Tag $TAG_NAME already exists, skipping"
216+ # Try to create the tag - will fail if it already exists
217+ if git tag "$TAG_NAME" 2>/dev/null; then
218+ git push origin "$TAG_NAME"
219+ echo "Created and pushed tag $TAG_NAME"
219220 else
220- git tag "$TAG_NAME"
221- if git rev-parse "$TAG_NAME" >/dev/null 2>&1; then
222- git push origin "$TAG_NAME"
223- echo "Created and pushed tag $TAG_NAME"
224- else
225- echo "Failed to create tag $TAG_NAME"
226- exit 1
227- fi
221+ echo "Tag $TAG_NAME already exists, skipping"
228222 fi
229223 env :
230224 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments