Open asymmetric opened 3 years ago
OTOH, I should assume that any program with access to the environment could theoretically read the GITHUB_TOKEN
env var, so some could argue this is "security theater" :thinking:
What is your thread model that we would prevent by not using the token that is already there? Rather than an environment variable I would rather add an additional file.
As a follow-up to #168, support for reading a GitHub API token from
GITHUB_TOKEN
was implemented in https://github.com/Mic92/nixpkgs-review/commit/c837ed77481bd32ff0cc774f3df4344ffc3ba75a. I actually think this is a bad idea.The gh docs state that the required scopes for this token include
repo
, which gives full admin access to all repos, including private ones. This means that nixpkgs-review now has access to those as well.Wouldn't it make more sense to have a nixpkgs-review specific env var, pointing to a compartimentalized token?
Note that it's not possible to run
gh auth login --with-token
when theGITHUB_TOKEN
env var is set, so if you (like me) want to keep the two tokens separate, you'd have always specify--token
in nixpkgs-review)