Skip to content

Instantly share code, notes, and snippets.

@PsyGik
Created September 16, 2021 18:23
Show Gist options
  • Save PsyGik/f0776d91b23c365e1874223e6e0d1e48 to your computer and use it in GitHub Desktop.
Save PsyGik/f0776d91b23c365e1874223e6e0d1e48 to your computer and use it in GitHub Desktop.
JS Snippet to mass unwatch Repos when you are added into a team with 8486578561285 repos...
(function() {
let qx = $x;
let unwatch = function(org, notificationType) {
let nodes = document.querySelectorAll('.Box-row');
let rows = [ ...nodes ];
let orgRows = rows.filter(e => e.innerText.startsWith(`${org}/`));
let orgUnsubButtons = orgRows.map(row => row.querySelector(`button.SelectMenu-item[value="${notificationType}"]`));
orgUnsubButtons.forEach(button => button.click());
setTimeout(function() {
}, 1000);
};
let org = 'ORG'; // <--- change ORG to desired organization, and repeat for all pages. CASE sensitive
let notificationType = 'included'; // 'included' = participating and @mentions, 'subscribed' = all activity, 'ignore' = ignore
unwatch(org, notificationType);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment