Skip to content

Unread notifications #32712

Answered by airtower-luna
willin asked this question in General
Sep 12, 2022 · 4 comments · 6 replies
Discussion options

You must be logged in to vote

I recently had that issue, too, it's a known bug. You can mark the ghost notification as read using the notifications API, you need a token with notifications scope to authorize the request.

I used the Python script below, which lists unread notifications before marking them as read and generally has some more output because I'm curious. It expects the token in the GH_TOKEN environment variable. 😸

import json
import os
import requests
from datetime import datetime, timezone

NOTIFICATIONS = 'https://api.github.com/notifications'

token = os.environ['GH_TOKEN']
s = requests.Session()
s.headers.update({
    'Authorization': f'Bearer {token}',
    'Accept': 'application/vnd.github+json'})

r = 

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@willin
Comment options

@linuxlawson
Comment options

Comment options

You must be logged in to vote
4 replies
@jleverenz
Comment options

@airtower-luna
Comment options

@javasgl
Comment options

@KubaJastrz
Comment options

Answer selected by willin
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants