Skip to content

Commit 9fea723

Browse files
committed
fix(github-cli): fix ensure_gh_extension_list_wrapper always creating gh wrapper
The check stripped GH_TOKEN along with the other auth env vars before running `gh extension list`, but gh CLI requires some token to be present just to run the extension subcommands, regardless of whether listing local extensions actually needs auth. With no token and a fresh empty GH_CONFIG_DIR, the check could never succeed, so the /usr/local/bin/gh wrapper was installed unconditionally instead of only when real gh actually fails to see the extensions.
1 parent fbd13b8 commit 9fea723

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/github-cli/scripts/install-extensions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ ensure_gh_extension_list_wrapper() {
4444

4545
gh_config_dir="$(mktemp -d)"
4646
if env \
47-
-u GH_TOKEN \
4847
-u GITHUB_TOKEN \
4948
-u GH_ENTERPRISE_TOKEN \
5049
-u GITHUB_ENTERPRISE_TOKEN \
5150
GH_CONFIG_DIR="${gh_config_dir}" \
51+
GH_TOKEN="gh-extension-list-check" \
5252
gh extension list >/dev/null 2>&1; then
5353
rm -rf "${gh_config_dir}"
5454
return

0 commit comments

Comments
 (0)