Remove unreadable GitHub notifications
This little post describes how to remove a special edge case of GitHub notifications that cannot be marked as read from the web interface
I had a problem with GitHub: years ago I starred a repository that remained silent for some time; recently the authors decided to catch the attention of everyone and wrote a bot to mention every stargazer in a GitHub issue, promoting the project.
Eventually the repository went private (got banned?).
The problem is that I still had the mention indicator in my GitHub notifications. There is no way to remove it from the web interface.
Eventually I managed the remove the notification by using the GitHub CLI.
Mark read a notification with GitHub CLI
- Install the GitHub CLI.
- Authenticate from GitHub CLI.
gh api notificationsto get a JSON containing all your notifications.
- Note the notification (thread) ID (
<id>) of the bad repository.
gh api --method PATCH notifications/threads/<id>to read all the notifications of the given thread ID.
Use the documentation as reference.