mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-23 21:16:06 +00:00
fix: exempt team members from compliance cleanup
This commit is contained in:
parent
39e7ff932d
commit
1268f8657e
6 changed files with 56 additions and 31 deletions
|
|
@ -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`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue