From 4e199d04504ac9e9abe7df21ecbfad5885f09f24 Mon Sep 17 00:00:00 2001 From: Mark Gentry Date: Fri, 10 Oct 2025 12:44:15 -0500 Subject: [PATCH] docs: Improve dispatch error output Improve dispatch error output when dispatch fails to authenticate with GitHub by describing permissions needed to authenticate. --- src/github.rs | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/github.rs b/src/github.rs index 1235278..5d66295 100644 --- a/src/github.rs +++ b/src/github.rs @@ -150,21 +150,35 @@ impl GitHubArgs { println!("No GitHub token found. Please authenticate with GitHub."); println!(); - println!("Option 1 - Use GitHub CLI (recommended):"); - println!(" gh auth login"); - println!(" # Re-run this command"); + println!("Option 1"); + println!(" Run 'gh auth login' and choose to authenticate via the"); + println!(" web browser flow."); + println!(" Re-run dispatch."); println!(); - println!("Option 2 - Create a Personal Access Token manually:"); - println!(" 1. Visit: https://github.com/settings/tokens/new"); - println!(" 2. Select scopes (permissions needed):"); - println!(" • Repository access: Select your target repository"); - println!(" • Repository permissions:"); - println!(" - Contents: Read (for downloading release assets)"); - println!(" - Issues: Write (for creating issues)"); - println!(" 3. Click 'Generate token'"); + println!("Option 2"); + println!(" Run 'gh auth login' and choose to authenticate by pasting"); + println!(" an authentication token."); println!(); - println!(" export GITHUB_TOKEN="); - println!(" # Re-run this command"); + println!(" Fine-grained authentication token (PAT)"); + println!(" If using a fine-grained PAT, it must have, at a minimum,"); + println!(" the following permissions:"); + println!(" Contents: Read-only access"); + println!(" Issues: Read and write access"); + println!(); + println!(" Classic PAT"); + println!(" If using a classic PAT, it must have, at a minimum,"); + println!(" the 'repo' permission."); + println!(); + println!(" Re-run dispatch."); + println!(); + println!("Option 3"); + println!(" Use the dispatch --token command line option and specify"); + println!(" either a fine-grained or a classic PAT as described above."); + println!(); + println!("Option 4"); + println!(" Set an environment variable named GITHUB_TOKEN to either"); + println!(" a fine-grained or a classic PAT as described above."); + println!(" Re-run dispatch."); println!(); anyhow::bail!("GitHub authentication required. Please follow the instructions above.");