Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UserScript to Automatically clear GitHub CI Notifications
// ==UserScript==
// @name Clear CI Activity Notification
// @version 1.0.0
// @grant none
// @match https://github.com/notifications
// ==/UserScript==
const notifications = document.querySelectorAll('.notifications-list-item')
const ciNotifications = Array.from(notifications).filter( (el) => {
return el.querySelector('div > div > span').innerText === "ci activity"
}, [])
if( ciNotifications.length === 0 ) {
return;
}
ciNotifications.forEach( (el) => {
el.querySelector('input[type=checkbox]').click()
})
setTimeout( () => {
document.querySelector('button[title="Done"]').click()
}, 200)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment