Unable to Remove Notifications from Deleted (404) Repositories #177745
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
You might have to log in and out of ur account, or create an issue with GitHub support. This is what I found somewhere else... Use the GitHub API (Most Likely to Work) Step 1: Create a Personal Access Token Click "Personal access tokens" > "Tokens (classic)". Click "Generate new token" > "Generate new token (classic)". Give the token a Note (e.g., "Clear Stuck Notifications"). Set the Expiration to 7 days (you will delete this token right after you use it). In the "Select scopes" section, check the box for notifications. This is the only permission needed. Scroll to the bottom and click "Generate token". Copy the token (it looks like ghp_...). Keep this somewhere safe for the next step. Do not close the page until you have copied it. Step 2: Use the Token to Clear Notifications Method A: Using GitHub CLI (gh) If you have the GitHub CLI installed, this is the easiest way. Open your Terminal or Command Prompt. Run the following command, pasting your copied token when prompted: Bash gh auth login --with-token Bash gh api -X PUT /notifications |
Beta Was this translation helpful? Give feedback.
-
|
@dcb9, I found a solution based on @ettechh findings. First you need to get all notifications (setting gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/notifications?all=true"This will also include the phishing repos ( "repository": {
"full_name": "Gitcoin-Developer/gitcoin.com",
"url": "https://api.github.com/notifications/threads/19103568493",
}Using the thread id ( gh api \
--method DELETE \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"/notifications/threads/19103568493" |
Beta Was this translation helpful? Give feedback.


You might have to log in and out of ur account, or create an issue with GitHub support.
This is what I found somewhere else...
Use the GitHub API (Most Likely to Work)
This is the most reliable technical solution. You will create a temporary Personal Access Token (PAT) to tell the GitHub API to mark all your notifications as read, which almost always clears stuck ones.
Step 1: Create a Personal Access Token
Go to your GitHub Developer Settings: https://github.com/settings/tokens
Click "Personal access tokens" > "Tokens (classic)".
Click "Generate new token" > "Generate new token (classic)".
Give the token a Note (e.g., "Clear Stuck Notifications").
Set the Expiration to 7 days (you will d…