Skip to content

GHA-290 Fix publish-github-release: strip build suffix from release title#149

Merged
kirill-knize-sonarsource merged 1 commit into
masterfrom
fix/publish-github-release-title
May 11, 2026
Merged

GHA-290 Fix publish-github-release: strip build suffix from release title#149
kirill-knize-sonarsource merged 1 commit into
masterfrom
fix/publish-github-release-title

Conversation

@kirill-knize-sonarsource
Copy link
Copy Markdown
Member

@kirill-knize-sonarsource kirill-knize-sonarsource commented May 11, 2026

Release title was incorrectly containing the build number like 5.2.3+12345.
Now it is correct with just 5.2.3.

@hashicorp-vault-sonar-prod
Copy link
Copy Markdown

hashicorp-vault-sonar-prod Bot commented May 11, 2026

GHA-290

@sonar-review-alpha
Copy link
Copy Markdown
Contributor

sonar-review-alpha Bot commented May 11, 2026

Summary

This PR fixes GitHub release creation to strip build metadata from release titles while preserving the full version in git tags.

The problem: When a version includes build metadata (e.g., 1.2.3+build123), the release title becomes cluttered. GitHub release titles should be clean and human-readable.

The solution:

  • Release titles now use the clean version without metadata (e.g., 1.2.3)
  • Git tags retain the full version with metadata (e.g., 1.2.3+build123)
  • When reusing existing draft releases, the code now aligns VALIDATED_VERSION with the existing tag to ensure downstream steps use the correct version

This ensures releases display nicely in GitHub while maintaining technically accurate git tags.

What reviewers should know

Key change to review:

  • Line 115-116: The core logic strips metadata using ${VALIDATED_VERSION%%+*}, which removes everything after the first +
  • Line 137-138: When reusing a draft release, the code sets VALIDATED_VERSION=$EXISTING_TAG to propagate the correct tag to subsequent workflow steps

What to verify:

  1. The bash parameter expansion syntax is correct and handles edge cases (e.g., versions without +)
  2. The logic for reusing existing draft releases properly aligns the version with the tag
  3. The updated log messages (line 134) help with debugging when releases are reused

Testing considerations:

  • Test with versions that have build metadata (1.2.3+build)
  • Test with versions without metadata (1.2.3) to ensure they work unchanged
  • Test the draft release reuse path to confirm the tag is correctly propagated

  • Generate Walkthrough
  • Generate Diagram

🗣️ Give feedback

sonar-review-alpha[bot]

This comment was marked as resolved.

@kirill-knize-sonarsource kirill-knize-sonarsource force-pushed the fix/publish-github-release-title branch from 2bad8e0 to 54d12a1 Compare May 11, 2026 13:02
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@sonar-review-alpha sonar-review-alpha Bot left a comment

Choose a reason for hiding this comment

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

LGTM! ✅

🗣️ Give feedback

@kirill-knize-sonarsource kirill-knize-sonarsource merged commit 706e442 into master May 11, 2026
11 checks passed
@kirill-knize-sonarsource kirill-knize-sonarsource deleted the fix/publish-github-release-title branch May 11, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants