Created
July 8, 2025 06:43
-
-
Save jeromedalbert/b36a2dba11b803b2486355e7bfed3ce2 to your computer and use it in GitHub Desktop.
Function to remove GH notifications via API call
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear-gh-notifications() { | |
local now=$(date -u +"%Y-%m-%dT%H:%M:%SZ") | |
curl -L \ | |
-X PUT \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_API_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/notifications \ | |
-d "{\"last_read_at\":\"$now\",\"read\":true}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment