Skip to content

Instantly share code, notes, and snippets.

@felipecustodio
Created September 6, 2025 03:07
Show Gist options
  • Save felipecustodio/f4614f0840127a72bc8aecc7702faeaf to your computer and use it in GitHub Desktop.
Save felipecustodio/f4614f0840127a72bc8aecc7702faeaf to your computer and use it in GitHub Desktop.
Worked somewhere, not anymore, but still subscribed to all the public repos? Here's a solution
$org = "YOUR_ORG_HERE"
# List org repos that you are subscribed to
$repos = gh api 'user/subscriptions?per_page=100' --paginate `
--jq ".[] | select(.owner.login==`"$org`") | .full_name"
if (-not $repos) { Write-Host "You’re not watching any $org repos."; exit }
# Unsubscribe
$repos | ForEach-Object {
$r = $_.Trim()
if ($r) {
Write-Host "Unwatching $r"
gh api -X DELETE "repos/$r/subscription" | Out-Null
}
}
# Verify: should print nothing
gh api 'user/subscriptions?per_page=100' --paginate `
--jq ".[] | select(.owner.login==`"$org`") | .full_name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment