Skip to content

fix(copilot-cli): use semver sort for prerelease tag resolution#1657

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/copilot-cli-fix-prerelease-tag-sort
Open

fix(copilot-cli): use semver sort for prerelease tag resolution#1657
Copilot wants to merge 2 commits into
mainfrom
copilot/copilot-cli-fix-prerelease-tag-sort

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 19, 2026

The prerelease channel resolves the install candidate via git ls-remote --tags | tail -1, which sorts alphabetically. This picks v1.0.9 over v1.0.45 because "9" > "4" lexicographically.

Fix: Replace the alphabetic tail with a version-sorted pipeline:

git ls-remote --tags https://github.com/github/copilot-cli \
  | awk '{print $2}' | sed 's|refs/tags/||' \
  | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9]+)?' \
  | sort -V | tail -n1
  • Filter to well-formed vX.Y.Z[-N] tags (excludes stray refs)
  • Sort with sort -V (version sort) instead of relying on git's lexicographic order
  • Bump feature version 1.1.21.1.3

Copilot AI changed the title [WIP] Fix prerelease channel to sort tags by version fix(copilot-cli): use semver sort for prerelease tag resolution May 19, 2026
Copilot AI requested a review from Kaniska244 May 19, 2026 15:55
@Kaniska244 Kaniska244 marked this pull request as ready for review May 19, 2026 16:00
@Kaniska244 Kaniska244 requested a review from a team as a code owner May 19, 2026 16:00
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.

copilot-cli: prerelease channel uses alphabetic tag sort, resolves to v1.0.9 instead of latest

2 participants