fetchFromGitHub: refactor for scope clarity
Co-authored-by: Philip Taron <philip.taron@gmail.com>
This commit is contained in:
parent
1a72fa0e19
commit
42574f5205
@ -74,15 +74,16 @@ let
|
|||||||
# Use the archive URI for non-private repos, as the API endpoint has
|
# Use the archive URI for non-private repos, as the API endpoint has
|
||||||
# relatively restrictive rate limits for unauthenticated users.
|
# relatively restrictive rate limits for unauthenticated users.
|
||||||
url =
|
url =
|
||||||
let
|
if private then
|
||||||
endpoint = "/repos/${owner}/${repo}/tarball/${revWithTag}";
|
let
|
||||||
in
|
endpoint = "/repos/${owner}/${repo}/tarball/${revWithTag}";
|
||||||
if private
|
in
|
||||||
then
|
if githubBase == "github.com" then
|
||||||
if githubBase == "github.com"
|
"https://api.github.com${endpoint}"
|
||||||
then "https://api.github.com${endpoint}"
|
else
|
||||||
else "https://${githubBase}/api/v3${endpoint}"
|
"https://${githubBase}/api/v3${endpoint}"
|
||||||
else "${baseUrl}/archive/${revWithTag}.tar.gz";
|
else
|
||||||
|
"${baseUrl}/archive/${revWithTag}.tar.gz";
|
||||||
extension = "tar.gz";
|
extension = "tar.gz";
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user