Created
September 6, 2025 03:07
-
-
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
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
$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