Created
June 22, 2023 18:07
-
-
Save Tyrrrz/7bf335f3a6b41ba0deabb42a9bef7e3c to your computer and use it in GitHub Desktop.
GitHub CLI script to delete all issues by a user
This file contains 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
gh auth login --web | |
$repo = "" # set repo here | |
$author = "" # set author here | |
$issues = gh issue list --repo $repo --author $author --limit 1000 --json number,author,title | ConvertFrom-Json | |
foreach ($issue in $issues) { | |
$issueNumber = $issue.number | |
$issueAuthor = $issue.author.login | |
$issueTitle = $issue.title | |
Write-Host "Deleting issue: #$issueNumber $issueTitle (by $issueAuthor)..." | |
Read-Host -Prompt "Press ENTER to confirm..." | |
gh issue delete $issueNumber --yes | Out-Null | |
} | |
Write-Host "Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment