Skip to content

Instantly share code, notes, and snippets.

@jeromedalbert
Created July 8, 2025 06:43
Show Gist options
  • Save jeromedalbert/b36a2dba11b803b2486355e7bfed3ce2 to your computer and use it in GitHub Desktop.
Save jeromedalbert/b36a2dba11b803b2486355e7bfed3ce2 to your computer and use it in GitHub Desktop.
Function to remove GH notifications via API call
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