This tool checks student pull request status using the GitHub REST API.
npm i -g https://github.com/ace-n/ada-pr-checker
Optional: increase your GitHub rate limits
- Open the GitHub personal access token creation page in your browser
- Check only the
repo_status
andpublic_repo
checkboxes. Make sure any others are unchecked! - Click
Generate token
and copy the resulting value - Configure
prcheck
to use the token. Replace<YOUR_GITHUB_TOKEN>
in the command below with the value you obtained in the previous step:
prcheck setConfig githubAuthToken <YOUR_GITHUB_TOKEN>
This application uses configstore
for configuration.
Use the following commands to work with config values:
prcheck setConfig
- sets a config value (e.g.prcheck setconfig githubAuthToken <MY_TOKEN>
)prcheck getConfig
- prints a config value (e.g.prcheck getconfig githubAuthToken
)prcheck listConfig
- prints all config valuesprcheck deleteConfig
- unsets a config value (e.g. `prcheck deleteConfig)
The following are permitted config values:
githubAuthToken
- the Auth token to use when making GitHub requests. (Optional, but increases rate limits.)githubAuthors
- only review PRs authored by these usernames (wildcard:@
)githubOrg
- the GitHub organization (or username) that PRs are sent to (defaults toAda-C###
, where###
is the current cohort number)cacheExpiry
- how long to cache GitHub requests for before updating themallGithubRepos
- a list of GitHub repos to review ifprcheck check
receives a wildcard (@
)
prcheck <command>
Commands:
prcheck setConfig <key> <values...> Sets a config value.
prcheck getConfig <key> Gets a config value.
prcheck deleteConfig <key> Deletes a config value.
prcheck listConfig List all config values
prcheck check <repos...> Checks for PR status
Options:
--version Show version number [boolean]
--help Show help [boolean]
Examples:
prcheck setConfig githubAuthToken Set your GitHub auth token
MY_AUTH_TOKEN
prcheck setConfig githubAuthors ace-n Set a GitHub author to check by
default
prcheck setConfig githubAuthors ace-n Set multiple GitHub authors to check
shrutivanw by default
prcheck check repo_1 repo_2 Search for PRs from repo_1 and
repo_2. Filter authors based on
config.json (default: no filter)
prcheck check repo_1 repo_2 --authors Search for PRs from repo_1 and
user_1 user_2 repo_2 with authors user_1 and
user_2
prcheck check @ --authors user_1 user_2 Search for PRs from any repo with
authors user_1 and user_2
prcheck check @ --authors @ Search for PRs from all repos
authored by anyone
GitHub requests are cached in the cache/
directory. (This directory will automatically be created if it doesn't exist.)
Licensed under the Apache 2.0 license.