File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
.github/actions/ci/bicep-standard-ci Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -289,22 +289,27 @@ runs:
289289 branch_name="${{ steps.branch_info.outputs.branch_name }}"
290290 should_publish="${{ steps.determine_release_type.outputs.should_publish }}"
291291
292- echo "🏷️ Creating tag: $tag_name"
292+ echo "🏷️ Preparing to create tag: $tag_name"
293293 echo "🔀 For branch: $branch_name"
294294 echo "📋 Will publish release: $should_publish"
295295
296- # Create annotated tag
297- if [[ "$branch_name" == "main" ]]; then
298- git tag -a "$tag_name" -m "Release $tag_name from main branch"
299- else
300- git tag -a "$tag_name" -m "Development tag $tag_name from $branch_name branch (no release)"
301- fi
302-
303- # Fetch latest tags and set up authentication before pushing
296+ # Fetch latest tags first to check for existing tags
304297 git fetch --tags --force
298+
299+ # Check if tag already exists before creating it
305300 if git rev-parse "$tag_name" >/dev/null 2>&1; then
306- echo "⚠️ Tag $tag_name already exists. Skipping push."
301+ echo "⚠️ Tag $tag_name already exists locally or remotely . Skipping tag creation and push."
307302 else
303+ echo "✅ Tag $tag_name does not exist. Creating new tag..."
304+
305+ # Create annotated tag
306+ if [[ "$branch_name" == "main" ]]; then
307+ git tag -a "$tag_name" -m "Release $tag_name from main branch"
308+ else
309+ git tag -a "$tag_name" -m "Development tag $tag_name from $branch_name branch (no release)"
310+ fi
311+
312+ # Push the newly created tag
308313 git push origin "$tag_name"
309314 echo "✅ Tag $tag_name created and pushed successfully"
310315 fi
You can’t perform that action at this time.
0 commit comments