diff --git a/shell/lib/github.sh b/shell/lib/github.sh index 5516d4aa..e98bfb11 100644 --- a/shell/lib/github.sh +++ b/shell/lib/github.sh @@ -85,6 +85,13 @@ install_latest_github_release() { info "Using $slug:${binary_name} version: ($tag)" + # Strip a leading `v` (before a digit) so mise receives a normalized version. + # mise 2026.6.14+ drops the `v` when installing a pre-release tag but re-adds + # it during `mise which`/`mise where`, so the tool resolves as not installed. + if [[ $tag =~ ^v[0-9] ]]; then + tag="${tag#v}" + fi + # Need to export GITHUB_TOKEN so that future calls to `mise` # continue to use it for the configured private repos. if [[ -z ${GITHUB_TOKEN:-} ]]; then diff --git a/shell/lib/github_test.bats b/shell/lib/github_test.bats index dff6c25c..50bf27c1 100644 --- a/shell/lib/github_test.bats +++ b/shell/lib/github_test.bats @@ -18,8 +18,11 @@ setup() { export MISE_GLOBAL_CONFIG_ROOT="$MISE_CONFIG_DIR" export MISE_GLOBAL_CONFIG_FILE="$MISE_CONFIG_DIR/global.toml" export MISE_OVERRIDE_CONFIG_FILENAMES="global.toml" - echo '[tools]' >>"$MISE_GLOBAL_CONFIG_FILE" - echo 'github-cli = "latest"' >>"$MISE_GLOBAL_CONFIG_FILE" + { + echo '[tools]' + echo 'github-cli = "latest"' + echo 'wait-for-gh-rate-limit = "1.1.1"' + } >>"$MISE_GLOBAL_CONFIG_FILE" } teardown() { @@ -49,6 +52,7 @@ teardown() { assert mise which stencil run "$(mise which stencil)" --version + assert_success } @test "install_latest_github_release should be able to download and install the latest pre-release of a repo" { @@ -61,5 +65,6 @@ teardown() { assert mise which stencil run "$(mise which stencil)" --version + assert_success assert_output --regexp "(rc|unstable)" }