You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
scripts/zx/clean_notifications.mjs

25 lines
775 B
JavaScript

#!/usr/bin/env zx
$.verbose = false;
const git = await import("./lib/git.js")
const notificationsOutput = await $`gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /notifications`
const notifications = JSON.parse(notificationsOutput.stdout);
const ibcGoNotifications = []
for (let n of notifications) {
// console.log(n);
if (git.shouldDeleteNotification(n)) {
const id = n.id;
// const resp = await $`gh api -X DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /notifications/threads/${id}/subscription`;
// console.log(resp.stdout)
console.log(n)
}
//
// if (n.repository.name === "ibc-go") {
// ibcGoNotifications.push(n);
// }
}