Fix release tag validation for pi-model-auto-router #15

Merged
Copilot merged 1 commit from copilot/release-latest-version into main 2026-09-22 20:37:32 +08:00
Copilot commented 2026-09-22 20:36:39 +08:00 (Migrated from github.com)

The release pipeline was too strict about tag naming and could reject valid release tags for pi-model-auto-router, preventing the latest version from being published. This change keeps the release flow aligned with both historical and current tag conventions while enforcing a strict version match between the tag and package.json.

  • What changed

    • Added workflow support for both pi-model-auto-router/vX.Y.Z and legacy pi-model-auto-router-vX.Y.Z tags.
    • Normalized tag parsing so each format extracts the correct semantic version before validation.
    • Kept the version gate strict: the published tag must exactly match the version field in pi-model-auto-router/package.json.
    • Preserved the existing publication flow and GitHub release creation behavior.
  • Why this matters

    • Valid release tags are no longer rejected based on naming convention alone.
    • The workflow blocks invalid mismatches instead of publishing a release that diverges from the package manifest.
    • The repo can publish the latest release without depending on a single tag style.
if [[ "${GITHUB_REF_NAME}" == pi-model-auto-router/v* ]]; then
  TAG_VERSION="${GITHUB_REF_NAME#pi-model-auto-router/v}"
elif [[ "${GITHUB_REF_NAME}" == pi-model-auto-router-v* ]]; then
  TAG_VERSION="${GITHUB_REF_NAME#pi-model-auto-router-v}"
fi
The release pipeline was too strict about tag naming and could reject valid release tags for `pi-model-auto-router`, preventing the latest version from being published. This change keeps the release flow aligned with both historical and current tag conventions while enforcing a strict version match between the tag and `package.json`. - What changed - Added workflow support for both `pi-model-auto-router/vX.Y.Z` and legacy `pi-model-auto-router-vX.Y.Z` tags. - Normalized tag parsing so each format extracts the correct semantic version before validation. - Kept the version gate strict: the published tag must exactly match the `version` field in `pi-model-auto-router/package.json`. - Preserved the existing publication flow and GitHub release creation behavior. - Why this matters - Valid release tags are no longer rejected based on naming convention alone. - The workflow blocks invalid mismatches instead of publishing a release that diverges from the package manifest. - The repo can publish the latest release without depending on a single tag style. ```yaml if [[ "${GITHUB_REF_NAME}" == pi-model-auto-router/v* ]]; then TAG_VERSION="${GITHUB_REF_NAME#pi-model-auto-router/v}" elif [[ "${GITHUB_REF_NAME}" == pi-model-auto-router-v* ]]; then TAG_VERSION="${GITHUB_REF_NAME#pi-model-auto-router-v}" fi ```
Sign in to join this conversation.
No description provided.