Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doctor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ CYAN='\033[0;36m'
MAGENTA='\033[0;35m'
BOLD='\033[1m'
NC='\033[0m' # No Color
# Variable for the GitHub host, defaults to 'github.com'
GITHUB_HOST="${GITHUB_HOST:-github.com}"
GITHUB_HOST="${GITHUB_HOST#https://}"
GITHUB_HOST="${GITHUB_HOST#http://}"

# Resolve the sqlite3 command, handling Windows (Git Bash / MSYS2) paths
SQLITE3_CMD=""
Expand Down Expand Up @@ -1168,7 +1172,7 @@ run_setup() {
echo -e " ${BLUE}Classic PAT (fine-grained PATs do not currently support Copilot):${NC}"
echo " • copilot"
echo ""
echo -e "${YELLOW}Create one at: https://github.com/settings/tokens${NC}"
echo -e "${YELLOW}Create one at: https://${GITHUB_HOST}/settings/tokens${NC}"
echo ""
# Read from /dev/tty explicitly to ensure correct capture in all terminal environments
echo -n "Please provide the PAT and press Enter: "
Expand All @@ -1185,7 +1189,7 @@ run_setup() {
# --- CLI authentication (existing flow) ---
echo -e "${BLUE}🔐 Authenticating with GitHub Copilot...${NC}"
echo ""
if ! copilot login; then
if ! copilot login --host "https://${GITHUB_HOST}"; then
Copy link

Copilot AI Apr 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copilot login --host "https://${GITHUB_HOST}" will produce an invalid URL if GITHUB_HOST is provided with a scheme already (e.g., https://ghe.example.comhttps://https://...). Consider normalizing GITHUB_HOST (accept either hostname or full URL) before building the --host argument, and reuse the same host for the PAT instructions URL in this setup flow so GitHub Enterprise users aren’t directed to github.com.

Copilot uses AI. Check for mistakes.
echo ""
echo -e "${RED}❌ Authentication failed. Please try again.${NC}"
return 1
Expand Down