Fix release-drafter auto-tag to use normalized semver version instead of hash - #250
Conversation
Agent-Logs-Url: https://github.com/wallstop/unity-helpers/sessions/32186a99-a7bb-4d12-91c4-a289d11306dc Co-authored-by: wallstop <1045249+wallstop@users.noreply.github.com>
Agent-Logs-Url: https://github.com/wallstop/unity-helpers/sessions/32186a99-a7bb-4d12-91c4-a289d11306dc Co-authored-by: wallstop <1045249+wallstop@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Hardens the Release Drafter workflow’s version resolution so draft release metadata (tag_name/name) is always derived from a valid semver source (primarily CHANGELOG headers) and never from an invalid fallback such as a hash-like tag.
Changes:
- Update
.github/workflows/release-drafter.ymlto resolveVERSIONfromCHANGELOG.mdheaders with explicitUnreleasedguardrails and always PATCHtag_name/name. - Remove the “early exit” that previously skipped metadata sync when a changelog section already existed, while still avoiding duplicate changelog insertion.
- Extend
scripts/tests/test-sync-script-contracts.ps1with contract tests covering the new version-source precedence and PATCH behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
.github/workflows/release-drafter.yml |
Reworks version selection to use changelog-derived semver and ensures release metadata is always synchronized via PATCH. |
scripts/tests/test-sync-script-contracts.ps1 |
Adds regression contract checks asserting the workflow’s version resolution and metadata sync behavior. |
|
Copilot apply changes based on the comments in this thread Can you parse through the feedback, determine if any of it is relevant, and if it is, provide a comprehensive implementation to address the identified issues and any similar issues? Consider automation and additional diagnostics such as tests, logs, or githooks to help prevent this category of issue. If the feedback is relevant, when addressing it, consider the code base as a whole. Are there other files or code areas that this could apply to? If so, do a sweep of those to see if they exhibit similar issues, and if they do, apply similar, appropriate fixes. The idea is to prevent the entire concept and class of issue from happening in the future. I'm only interested in general, complete fixes. I want to avoid fragility and make these checks extremely robust and reliable. Please simplify wherever possible to achieve this. Feel free to do web searches to understand modern techniques, approaches, and best practices to this and any similar issues. When changing files, make sure we abide by repo guidelines and rules. If there is any new knowledge learned, be sure to update llm info appropriately. Please use sub-agents to accomplish these goals. Once a sub-agent is done, have another sub-agent review its work in an adversarial fashion. If there are any recommendations, have another sub-agent consider them and implement them. Repeat this process in a loop until all sub-agents achieve consensus that the result is incredibly high quality (110/100, exceptional work, absolutely zero issues, minor or otherwise) and does not require any revisions. I want 110% here, give it all you've got! |
Agent-Logs-Url: https://github.com/wallstop/unity-helpers/sessions/9132e858-1a91-4476-b36a-b0476aa495cd Co-authored-by: wallstop <1045249+wallstop@users.noreply.github.com>
Implemented and pushed the requested fixes in I applied the review-thread feedback by normalizing semver-like release-drafter tags to repo tag format (stripping leading |
There was a problem hiding this comment.
Pull request overview
Hardens the release-drafter GitHub Actions workflow so release tags/names are always derived from a valid semver source (primarily CHANGELOG.md), preventing hash-like or v-prefixed tags from being used as release metadata.
Changes:
- Update
.github/workflows/release-drafter.ymlto resolveVERSIONfrom changelog headers (with guarded fallbacks) and normalizev/V-prefixed semver-like drafter tags. - Ensure release metadata (
tag_nameandname) is always PATCHed to the resolvedVERSION, even when the release body already contains a changelog section. - Add/extend contract tests in
scripts/tests/test-sync-script-contracts.ps1to enforce the workflow’s version-selection and guardrail behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
scripts/tests/test-sync-script-contracts.ps1 |
Adds contract tests validating release-drafter workflow version sourcing, normalization, and PATCH behavior. |
.github/workflows/release-drafter.yml |
Changes version resolution to be changelog-driven with semver validation/normalization, and always syncs release tag/name metadata. |
Description
Version Auto-Draft could publish draft releases with a hash-like tag instead of the intended semver version. This update hardens version resolution so release metadata (
tag_name/name) is always set from a valid semver source and never from an invalid fallback.Workflow version resolution
CHANGELOG.mdheader when it is semver.Unreleased, prefer semver-likerelease-drafteroutput; otherwise fallback to next semver changelog header.release-draftertags by stripping leadingv/Vbefore assigningVERSION, so release tags remain consistent with repository conventions.Unreleasedfrom being used as release tag/name.Release metadata synchronization
tag_nameandnameto the resolved version.## Changelogalready existed in body.Regression contract coverage
test-sync-script-contracts.ps1with release-drafter contract assertions for:Unreleasedguardrails,tag_name,v/Vnormalization behavior for semver-like drafter tags.Related Issue
Resolves the Version Auto-Draft behavior where release tags could be hash-like or
v-prefixed instead of the expected unprefixed semver format.Type of Change
Checklist