Created
March 25, 2020 13:18
-
-
Save hypervillain/fbc14f8c5660d69eed98ea269b53e820 to your computer and use it in GitHub Desktop.
Delete a list of Github repositories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { Octokit } = require('@octokit/rest') | |
const octo = new Octokit({ | |
auth: 'an-access-token-with-delete-repo-scope' | |
}) | |
/** try w/ one first 😛 */ | |
const repos = ['travis-tests'] | |
const owner = 'hypervillain' | |
async function main() { | |
repos.forEach(async(repo) => { | |
const { status } = await octo.repos.delete({ | |
owner, | |
repo, | |
}) | |
// should be 204 | |
console.log(`status for repo "${repo}": ${status}`) | |
}) | |
} | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment