Skip to content

Commit e80024e

Browse files
Use gh_cli_jll for automatic authentication
- Added gh_cli_jll as a dependency - Implemented get_gh_command() to select between system gh and JLL gh - Updated all gh CLI calls to use the wrapper function - Auto-login now works even when gh is not installed on the system - Falls back to JLL-provided gh binary automatically This ensures the auto-authentication feature works on all systems, regardless of whether gh CLI is installed.
1 parent e970f68 commit e80024e

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/LinearSolveAutotune/src/telemetry.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ Returns an authentication method indicator if successful, nothing if setup fails
2525
"""
2626
function setup_github_authentication(; auto_login::Bool = true)
2727
# 1. Check for `gh` CLI (system or JLL)
28+
gh_cmd = get_gh_command()
29+
30+
# First check if already authenticated
2831
try
29-
gh_cmd = get_gh_command()
3032
# Suppress output of gh auth status check
3133
if success(pipeline(`$gh_cmd auth status`; stdout=devnull, stderr=devnull))
3234
# Check if logged in to github.com
@@ -37,7 +39,7 @@ function setup_github_authentication(; auto_login::Bool = true)
3739
end
3840
end
3941
catch e
40-
@debug "gh CLI check failed: $e"
42+
@debug "gh CLI auth status check failed: $e"
4143
end
4244

4345
# 2. Check for GITHUB_TOKEN environment variable
@@ -49,9 +51,8 @@ function setup_github_authentication(; auto_login::Bool = true)
4951
end
5052
end
5153

52-
# 3. If auto_login is enabled, offer to authenticate using gh (system or JLL)
54+
# 3. If auto_login is enabled, offer to authenticate
5355
if auto_login
54-
gh_cmd = get_gh_command()
5556
println("\n🔐 GitHub authentication not found.")
5657
println(" To share results with the community, authentication is required.")
5758
println("\nWould you like to authenticate with GitHub now? (y/n)")
@@ -64,7 +65,7 @@ function setup_github_authentication(; auto_login::Bool = true)
6465
println(" Please follow the prompts to complete authentication.\n")
6566

6667
try
67-
# Run gh auth login interactively using the wrapper command
68+
# Run gh auth login interactively (using system gh or JLL)
6869
run(`$gh_cmd auth login`)
6970

7071
# Check if authentication succeeded

0 commit comments

Comments
 (0)