- Have
gh
(GitHub CLI) installed locally and logged into your GitHub account (i.e.gh auth login
). - Execute the following command to clear rogue/frozen unread notifications:
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
/notifications \
-f last_read_at="$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
-F read=true
If you don't have GNU's date
command installed locally you can use:
gh api \
--method PUT \
-H "Accept: application/vnd.github+json" \
/notifications \
-f last_read_at='2022-06-10T00:00:00Z' \
-F read=true
And voila, now you can go on your day peacefully with no unread notifications.