I've needed to do this several times to combat "ghost" notifications. These occur when a discussion is created and then deleted (e.g. for spam) before the notofication is read. You may see something like "1-0 of 4" at the bottom of the notifications page.
You can use the GitHub API client to show these notifications:
gh api notifications
To mark all notifications as read, send the API request below with curl. (Update the last_read date as needed.)
curl -L \
-X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/notifications \
-d '{"last_read_at":"2024-06-12T00:00:00Z","read":true}'
Unfortunately, this does not delete ghost notifications; it only marks them as read. But this at least fixes the constant notification alert.
I'm having this problem again, and unlike before, it doesn't have the blue dot, it just shows up in the repository. I have now found this COMMENT that solves the problem:
https://github.com/orgs/community/discussions/6874#discussioncomment-14507162