Skip to content

fix(release): normalize version input before semver validation#96

Merged
itlackey merged 2 commits into
mainfrom
copilot/fix-bump-version-tag-failure
Jul 6, 2026
Merged

fix(release): normalize version input before semver validation#96
itlackey merged 2 commits into
mainfrom
copilot/fix-bump-version-tag-failure

Conversation

Copilot AI commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The "Bump Version & Tag" job fails when the version input is dispatched with a non-semver prefix (e.g. print-md v0.7.1-beta.2), which doesn't match the ^[0-9]+\.[0-9]+\.[0-9]+... validation regex.

Change

Add a normalization step at the top of the Validate dispatch branch and version run block that strips any leading non-digit characters before validation and writes the cleaned value back to $GITHUB_ENV so all subsequent steps in the version job receive it:

VERSION="$(echo "$VERSION" | sed -E 's/^[^0-9]*([0-9])/\1/')"
echo "VERSION=$VERSION" >> "$GITHUB_ENV"

Handles "print-md v0.7.1-beta.2""0.7.1-beta.2", "v1.2.3""1.2.3", and plain semver passthrough unchanged.

Strip any leading non-semver prefix (e.g. "print-md v" or bare "v")
from the dispatched version input before the regex validation and all
subsequent steps in the version job.

Fixes: "Bump Version & Tag" job failure caused by dispatching
"print-md v0.7.1-beta.2" instead of plain "0.7.1-beta.2".
@itlackey itlackey marked this pull request as ready for review July 6, 2026 19:34
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Bump Version & Tag fix(release): normalize version input before semver validation Jul 6, 2026
@itlackey itlackey merged commit 612fa73 into main Jul 6, 2026
@itlackey itlackey deleted the copilot/fix-bump-version-tag-failure branch July 6, 2026 19:35
Copilot stopped work on behalf of itlackey due to an error July 6, 2026 19:35
Copilot AI requested a review from itlackey July 6, 2026 19:35
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