From 6b4dbb4caa7602c03c078cc861c326f660316c71 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:21:36 +1000 Subject: [PATCH] Fix: Ignore invalid Github Token (#1839) * Fix: Ignore empty Github Token Empty GitHub Token is invalid, it should not be used. * Fix compilation And detect more invalid tokens Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/src/args.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 8fbe09e5..195f25f1 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -609,6 +609,10 @@ You cannot use --{option} and specify multiple packages at the same time. Do one opts.github_token = Some(GithubToken(Zeroizing::new(github_token.into()))); } } + match opts.github_token.as_ref() { + Some(token) if token.0.len() < 10 => opts.github_token = None, + _ => (), + } opts }