1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

Re-add support for github-access-token, but mark as deprecated.

This commit is contained in:
Kevin Quick 2020-09-25 08:09:56 -07:00
parent ef2a14be19
commit 5a35cc29bf
No known key found for this signature in database
GPG key ID: E6D7733599CC0A21
2 changed files with 11 additions and 1 deletions

View file

@ -146,7 +146,17 @@ struct GitArchiveInputScheme : InputScheme
auto tokens = settings.accessTokens.get();
auto pat = tokens.find(host);
if (pat == tokens.end())
{
if ("github.com" == host)
{
auto oldcfg = settings.githubAccessToken.get();
if (!oldcfg.empty()) {
warn("using deprecated 'github-access-token' config value; please use 'access-tokens' instead");
return oldcfg;
}
}
return std::nullopt;
}
return pat->second;
}