Repository navigation
feat(download): Enhance Get-GitHubToken to include more token sources - #6712
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. Summary by CodeRabbit
WalkthroughDownload failures now report issue context, aria2 fallback can be disabled, and download output formatting is updated. ChangesDownload handling
GitHub token resolution
Merge Risk: 🔵 Low · up to The change broadens GitHub authentication lookup to support GH_TOKEN and GITHUB_TOKEN. The branch remains mergeable with owner awareness that diagnostics may expose sensitive connection data and some download failures may be reported with misleading error text; these issues should receive follow-up. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Better yet, check for and run |
|
Please target to develop branch |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
lib/download.ps1 (3)
456-465: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winRemove secrets from aria2 diagnostics.
When cookies or proxy credentials are configured,
$aria2containsCookievalues and--all-proxy-passwdvalues from the options built at Lines 364-377. The newerror $aria2andwarn $aria2statements print these values.$urlstxt_contentcan also contain signed URLs. Redact credentials and URL tokens before output, or report only sanitized metadata.
24-27: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse an accurate failure message for download exceptions.
Invoke-CachedDownloadcan fail because of authentication, timeouts, network errors, or file I/O. Both catch blocks report every failure asURL $url is not valid. Report a generic download failure or classify the exception before reporting it.Also applies to: 473-476
456-476: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winMove aria2 cleanup into
finally.When
abortruns at lines 460 or 476, it exits before removing$urlstxtand.aria2control files. Place temporary-file cleanup and console restoration in afinallyblock around the aria2 and fallback operations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8319e1a4-1476-4656-9514-3d93d1f4f4a1
📒 Files selected for processing (1)
lib/download.ps1
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
https://cli.github.com/manual/gh_help_environment
This pull request makes a small update to the
Get-GitHubTokenfunction inlib/download.ps1to improve how GitHub authentication tokens are retrieved.GH_TOKENandGITHUB_TOKEN, in addition to the previously checked variables, to find a valid GitHub token for authentication.