Skip to content

Instantly share code, notes, and snippets.

@hypervillain
Created March 25, 2020 13:18
Show Gist options
  • Save hypervillain/fbc14f8c5660d69eed98ea269b53e820 to your computer and use it in GitHub Desktop.
Save hypervillain/fbc14f8c5660d69eed98ea269b53e820 to your computer and use it in GitHub Desktop.
Delete a list of Github repositories
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