README
mutate-github-repositories-cli
CLI to run a custom script on one or multiple repositories
Usage
$ mutate-github-repositories [script] [repos...]
Positionals:
script Path to your *.js script
repos One or multiple arrays in the form of 'repo-owner/repo-name'
[default: []]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--token Requires the "public_repo" scope for public repositories, "repo"
scope for private repositories. [string] [required]
--cache Cache responses for debugging [boolean] [default: false]
The script
must export a default function which takes three parameters:
module.exports = exampleScript;
module.exports = async function myScript(octokit, repository, options) {
// do something here
};
octokit
is an instance of@octokit/core
with the@octokit/plugin-paginate-rest
pluginrepository
is the response data ofGET /repos/{owner}/{repo}
options
are all options passed to the CLI which are not used bymutate-github-repositories
.
Example
$ npx mutate-github-repositories-cli \
--token 0123456789012345678901234567890123456789 \
example.js \
octokit/*
See example.js for the syntax of a script.