fix: exempt team members from compliance cleanup

This commit is contained in:
Aiden Cline 2026-05-21 16:15:45 -05:00 committed by GitHub
parent 39e7ff932d
commit 1268f8657e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 56 additions and 31 deletions

View file

@ -15,8 +15,11 @@ const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000)
type Issue = {
number: number
updated_at: string
author_association: string
}
const teamAssociations = new Set(["OWNER", "MEMBER", "COLLABORATOR"])
const headers = {
Authorization: `Bearer ${token}`,
"Content-Type": "application/json",
@ -63,6 +66,10 @@ async function main() {
for (const i of all) {
const updated = new Date(i.updated_at)
if (updated < cutoff) {
if (teamAssociations.has(i.author_association)) {
console.log(`Skipping #${i.number}: author association is ${i.author_association}`)
continue
}
stale.push(i.number)
} else {
console.log(`\nFound fresh issue #${i.number}, stopping`)