ci: centralize team list in @opencode-ai/script package and use beta label filter
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bun
|
||||
|
||||
import { $ } from "bun"
|
||||
import { Script } from "@opencode-ai/script"
|
||||
|
||||
interface PR {
|
||||
number: number
|
||||
@@ -32,28 +31,12 @@ Please resolve this issue to include this PR in the next beta release.`
|
||||
}
|
||||
|
||||
async function main() {
|
||||
console.log("Fetching open PRs with beta label from team members...")
|
||||
console.log("Fetching open PRs with beta label...")
|
||||
|
||||
const allPrs: PR[] = []
|
||||
for (const member of Script.team) {
|
||||
try {
|
||||
const stdout =
|
||||
await $`gh pr list --state open --author ${member} --label beta --json number,title,author,labels --limit 100`.text()
|
||||
const memberPrs: PR[] = JSON.parse(stdout)
|
||||
allPrs.push(...memberPrs)
|
||||
} catch {
|
||||
// Skip member on error
|
||||
}
|
||||
}
|
||||
const stdout = await $`gh pr list --state open --label beta --json number,title,author,labels --limit 100`.text()
|
||||
const prs: PR[] = JSON.parse(stdout)
|
||||
|
||||
const seen = new Set<number>()
|
||||
const prs = allPrs.filter((pr) => {
|
||||
if (seen.has(pr.number)) return false
|
||||
seen.add(pr.number)
|
||||
return true
|
||||
})
|
||||
|
||||
console.log(`Found ${prs.length} open PRs with beta label from team members`)
|
||||
console.log(`Found ${prs.length} open PRs with beta label`)
|
||||
|
||||
if (prs.length === 0) {
|
||||
console.log("No team PRs to merge")
|
||||
|
||||
Reference in New Issue
Block a user