Skip to content

Commit aa71e9c

Browse files
Copilotpelikhan
andauthored
fix: unset stale GH_HOST when configuring gh for github.com (#24222)
* Initial plan * fix: unset stale GH_HOST when github_host is github.com Agent-Logs-Url: https://github.com/github/gh-aw/sessions/30a6422b-97fb-4c86-bb2a-187e682fd2d2 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> * fix: omit stale GH_HOST value from log and clear rather than set in GITHUB_ENV Agent-Logs-Url: https://github.com/github/gh-aw/sessions/f7fa60de-4903-4101-bfa5-3211d8b0c0e0 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com> Co-authored-by: Peli de Halleux <pelikhan@users.noreply.github.com>
1 parent 33a0577 commit aa71e9c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

actions/setup/sh/configure_gh_for_ghe.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ main() {
7575
fi
7676
fi
7777
echo "Using public GitHub (github.com) - no additional gh configuration needed"
78+
# Clear any stale GH_HOST to prevent gh CLI mismatches
79+
if [ -n "${GH_HOST:-}" ] && [ "${GH_HOST}" != "github.com" ]; then
80+
echo "Clearing stale GH_HOST" >&2
81+
unset GH_HOST
82+
if [ -n "${GITHUB_ENV:-}" ]; then
83+
echo "GH_HOST=" >> "${GITHUB_ENV}"
84+
fi
85+
fi
7886
return 0
7987
fi
8088

0 commit comments

Comments
 (0)