Skip to content

ci: use majorMinorPatch for clean semver tags#91

Merged
mpaulosky merged 1 commit into
mainfrom
squad/91-gitversion-tag-format
Apr 20, 2026
Merged

ci: use majorMinorPatch for clean semver tags#91
mpaulosky merged 1 commit into
mainfrom
squad/91-gitversion-tag-format

Conversation

@mpaulosky

Copy link
Copy Markdown
Owner

GitVersion's semVer output includes pre-release height (e.g. v1.0.0-101).
On main, we want clean v1.0.1 format, which comes from majorMinorPatch.

This ensures the first post-sprint release is tagged v1.0.1, not v1.0.0-{height}.

semVer includes pre-release height on non-main branches, resulting in tags like
v1.0.0-101. On main, we want clean semver tags like v1.0.1, which comes from
the majorMinorPatch output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 22:32
@github-actions

Copy link
Copy Markdown
Contributor

🏗️ PR Added to Squad Triage Queue

This PR has been labeled with squad and added to the triage queue.

Next steps:

  • The squad Lead will review and assign to an appropriate team member
  • A squad:member label will be added after triage

If you know which squad member should handle this, you can add the appropriate squad:member label yourself.

@github-actions github-actions Bot added the squad Squad triage inbox — Lead will assign to a member label Apr 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Summary

Summary
Generated on: 04/20/2026 - 22:33:48
Coverage date: 04/20/2026 - 22:33:09 - 04/20/2026 - 22:33:30
Parser: MultiReport (4x Cobertura)
Assemblies: 4
Classes: 51
Files: 50
Line coverage: 66.4% (556 of 837)
Covered lines: 556
Uncovered lines: 281
Coverable lines: 837
Total lines: 2525
Branch coverage: 66.5% (189 of 284)
Covered branches: 189
Total branches: 284
Method coverage: Feature is only available for sponsors
Tag: 100_24693763913

Coverage

AppHost - 0%
Name Line Branch
AppHost 0% ****
Program 0%
Domain - 87.2%
Name Line Branch
Domain 87.2% 91.6%
Domain.Abstractions.Result 95% 50%
Domain.Abstractions.Result`1 75% 50%
MyBlog.Domain.Behaviors.ValidationBehavior`2 100% 100%
MyBlog.Domain.Entities.BlogPost 100%
MyBlog.Domain.Features.BlogPosts.Commands.CreateBlogPost.CreateBlogPostComm
and
100%
MyBlog.Domain.Features.BlogPosts.Commands.CreateBlogPost.CreateBlogPostComm
andHandler
100%
MyBlog.Domain.Features.BlogPosts.Commands.CreateBlogPost.CreateBlogPostComm
andValidator
0%
MyBlog.Domain.Features.BlogPosts.Commands.DeleteBlogPost.DeleteBlogPostComm
and
100%
MyBlog.Domain.Features.BlogPosts.Commands.DeleteBlogPost.DeleteBlogPostComm
andHandler
100%
MyBlog.Domain.Features.BlogPosts.Commands.DeleteBlogPost.DeleteBlogPostComm
andValidator
0%
MyBlog.Domain.Features.BlogPosts.Commands.UpdateBlogPost.UpdateBlogPostComm
and
100%
MyBlog.Domain.Features.BlogPosts.Commands.UpdateBlogPost.UpdateBlogPostComm
andHandler
100% 100%
MyBlog.Domain.Features.BlogPosts.Commands.UpdateBlogPost.UpdateBlogPostComm
andValidator
0%
MyBlog.Domain.Features.BlogPosts.Queries.GetAllBlogPosts.GetAllBlogPostsQue
ryHandler
100%
MyBlog.Domain.Features.BlogPosts.Queries.GetBlogPostById.GetBlogPostByIdQue
ry
100%
MyBlog.Domain.Features.BlogPosts.Queries.GetBlogPostById.GetBlogPostByIdQue
ryHandler
100% 100%
ServiceDefaults - 0%
Name Line Branch
ServiceDefaults 0% 0%
Microsoft.Extensions.Hosting.Extensions 0% 0%
Web - 68.7%
Name Line Branch
Web 68.7% 69%
MyBlog.Web.Components.Layout.MainLayout 100%
MyBlog.Web.Components.Layout.NavMenu 82.8% 71.4%
MyBlog.Web.Components.Pages.Error 100% 75%
MyBlog.Web.Components.Routes 0% 0%
MyBlog.Web.Components.Shared.RedirectToLogin 100%
MyBlog.Web.Data.BlogDbContext 100%
MyBlog.Web.Data.BlogPostDto 100%
MyBlog.Web.Data.BlogPostMappings 100%
MyBlog.Web.Data.MongoDbBlogPostRepository 100% 100%
MyBlog.Web.Features.BlogPosts.Create.Create 75% 50%
MyBlog.Web.Features.BlogPosts.Create.CreateBlogPostCommand 100%
MyBlog.Web.Features.BlogPosts.Create.CreateBlogPostCommandValidator 100%
MyBlog.Web.Features.BlogPosts.Create.CreateBlogPostHandler 100%
MyBlog.Web.Features.BlogPosts.Delete.ConfirmDeleteDialog 100% 100%
MyBlog.Web.Features.BlogPosts.Delete.DeleteBlogPostCommand 100%
MyBlog.Web.Features.BlogPosts.Delete.DeleteBlogPostCommandValidator 100%
MyBlog.Web.Features.BlogPosts.Delete.DeleteBlogPostHandler 100%
MyBlog.Web.Features.BlogPosts.Edit.Edit 88% 75%
MyBlog.Web.Features.BlogPosts.Edit.EditBlogPostCommand 100%
MyBlog.Web.Features.BlogPosts.Edit.EditBlogPostCommandValidator 100%
MyBlog.Web.Features.BlogPosts.Edit.EditBlogPostHandler 84% 90%
MyBlog.Web.Features.BlogPosts.Edit.GetBlogPostByIdQuery 100%
MyBlog.Web.Features.BlogPosts.List.GetBlogPostsHandler 100% 100%
MyBlog.Web.Features.BlogPosts.List.Index 86.8% 84.6%
MyBlog.Web.Features.UserManagement.AssignRoleCommand 100%
MyBlog.Web.Features.UserManagement.ManageRoles 90.4% 75%
MyBlog.Web.Features.UserManagement.Profile 97.2% 82%
MyBlog.Web.Features.UserManagement.RemoveRoleCommand 100%
MyBlog.Web.Features.UserManagement.RoleDto 100%
MyBlog.Web.Features.UserManagement.UserManagementHandler 0% 0%
MyBlog.Web.Features.UserManagement.UserWithRolesDto 100%
MyBlog.Web.Security.RoleClaimsHelper 91.8% 91.1%
Program 0% 0%

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Branch Rate Complexity Health
Domain 0% 0% 77
Web 0% 0% 337
ServiceDefaults 0% 0% 18
Domain 0% 0% 77
Web 0% 0% 337
ServiceDefaults 0% 0% 18
AppHost 0% 100% 1
Domain 20% 0% 77
Web 5% 1% 337
ServiceDefaults 0% 0% 18
AppHost 0% 100% 1
Domain 20% 0% 77
Web 5% 1% 337
ServiceDefaults 0% 0% 18
Domain 87% 92% 77
Web 64% 65% 337
ServiceDefaults 0% 0% 18
Domain 87% 92% 77
Web 64% 65% 337
ServiceDefaults 0% 0% 18
Summary 23% (1164 / 4982) 22% (382 / 1776) 2594

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adjusts CI tag creation to use a “clean” SemVer tag (no pre-release height) when tagging builds on main, aligning release tags with v{major}.{minor}.{patch}.

Changes:

  • Switch Git tag value from steps.gitversion.outputs.semVer to steps.gitversion.outputs.majorMinorPatch in the main push tagging step.

Comment thread .github/workflows/ci.yml
Comment on lines +149 to 152
TAG="v${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "Creating tag: $TAG"
git tag "$TAG" || echo "Tag already exists: $TAG"
git push origin "$TAG" || echo "Tag already pushed"

Copilot AI Apr 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Determine Version runs with continue-on-error: true, but the tag step uses steps.gitversion.outputs.majorMinorPatch without a fallback/validation. If GitVersion fails or outputs are empty, this will attempt to tag/push v (or an empty tag) and the || echo ... masking will hide the failure. Consider explicitly validating the version output is non-empty before tagging, and avoid swallowing non-"already exists" failures (e.g., fail the job or check whether the tag exists and points at the current commit).

Suggested change
TAG="v${{ steps.gitversion.outputs.majorMinorPatch }}"
echo "Creating tag: $TAG"
git tag "$TAG" || echo "Tag already exists: $TAG"
git push origin "$TAG" || echo "Tag already pushed"
set -euo pipefail
TAG="v${{ steps.gitversion.outputs.majorMinorPatch }}"
if [ -z "$TAG" ] || [ "$TAG" = "v" ]; then
echo "Error: GitVersion output 'majorMinorPatch' is empty; refusing to create or push tag."
exit 1
fi
CURRENT_COMMIT="$(git rev-parse HEAD)"
echo "Ensuring tag exists for current commit: $TAG -> $CURRENT_COMMIT"
if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then
TAG_COMMIT="$(git rev-list -n 1 "$TAG")"
if [ "$TAG_COMMIT" = "$CURRENT_COMMIT" ]; then
echo "Tag already exists and points to the current commit: $TAG"
exit 0
fi
echo "Error: Tag $TAG already exists but points to $TAG_COMMIT instead of $CURRENT_COMMIT."
exit 1
fi
git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1 && {
echo "Error: Tag $TAG already exists on origin but is not present locally. Fetch tags and verify its target before retrying."
exit 1
}
git tag "$TAG"
git push origin "$TAG"

Copilot uses AI. Check for mistakes.
@mpaulosky
mpaulosky merged commit 33a1048 into main Apr 20, 2026
12 checks passed
@mpaulosky
mpaulosky deleted the squad/91-gitversion-tag-format branch April 20, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

squad Squad triage inbox — Lead will assign to a member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants