This package defines the unified method for authenticating connections to Github's API. Tools which use this package all authenticate using access tokens. See the documentation for the specific tool to see what scopes are expected of a token.
Tools which use this package resolve access tokens using the following order:
- If the tool provides a list of paths that it expects to find access tokens in, first try and read a token from those.
- If
$GITHUB_ACCESS_TOKEN
is set, use it. - If
$GITHUB_ACCESS_TOKEN_PATH
is set and points to a file, attempt to read it. If the variable is set but the file does not exist, a warning is printed. - If
--github_access_token
is set, use it. - If
--github_credentials_path
points to a file, use it. - If we are in a test environment and
~/.github/access_tokens/test.txt
is a file, read the token from that.