Skip to content

Instantly share code, notes, and snippets.

@pyronaur
Created December 10, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pyronaur/5649c6167904324f792b0c31d7ffa3b0 to your computer and use it in GitHub Desktop.
Save pyronaur/5649c6167904324f792b0c31d7ffa3b0 to your computer and use it in GitHub Desktop.
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