Created
October 27, 2025 14:14
-
-
Save crowne/8d3e7cfec4b3b4063c6a979f0d53b3ee to your computer and use it in GitHub Desktop.
clear ghost notifications
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
| # Dump all notifications to find the ids of scam notifs | |
| gh api notifications > notifications.json | |
| # Read and parse the JSON file | |
| $notifications = Get-Content "notifications.json" | ConvertFrom-Json | |
| # Find all objects with "unread": true and display their URLs | |
| $notifications | Where-Object { $_.unread -eq $true } | ForEach-Object { | |
| Write-Output $_.url | |
| # Extract thread ID from URL (number after the last /) | |
| $thread_id = $_.url -replace '.*/', '' | |
| Write-Output "Deleting notification thread: $thread_id" | |
| gh api -X DELETE "notifications/threads/$thread_id" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment