Skip to content

Commit 8bcfd9d

Browse files
committed
docs: improve GitHub token setup messaging with config file path and env var alternatives
1 parent 0ed5a91 commit 8bcfd9d

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/github.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,14 @@ pub fn setup_github_token_interactive() -> Result<String> {
872872
println!("3. Scopes needed: repo (full control of private repos)");
873873
println!("4. Click \"Generate token\" and copy the value");
874874
println!();
875+
println!("Alternatively, set GITHUB_TOKEN or GH_TOKEN in your environment,");
876+
println!("or manually create the config file with:");
877+
if let Ok(config_path) = get_github_config_path() {
878+
println!(" {}", config_path.display());
879+
}
880+
println!("Contents:");
881+
println!(" default_token: ghp_yourtoken");
882+
println!();
875883
print!("Enter your token: ");
876884
io::stdout().flush()?;
877885

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ fn handle_pr_command(
13481348

13491349
// Ensure we have auth configured
13501350
if !has_github_token(&repo_id.host) {
1351-
println!("{}", "GitHub authentication required.".yellow());
1351+
println!("{}", "GitHub authentication required (needs a Personal Access Token with the 'repo' scope).".yellow());
13521352
setup_github_token_interactive()?;
13531353
}
13541354

0 commit comments

Comments
 (0)