Skip to content

Commit f390ac2

Browse files
committed
ci: centralize team list in @opencode-ai/script package and use beta label filter
1 parent 7837bbc commit f390ac2

File tree

3 files changed

+24
-37
lines changed

3 files changed

+24
-37
lines changed

packages/script/src/index.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,20 @@ const VERSION = await (async () => {
4646
return `${major}.${minor}.${patch + 1}`
4747
})()
4848

49+
const team = [
50+
"actions-user",
51+
"opencode",
52+
"rekram1-node",
53+
"thdxr",
54+
"kommander",
55+
"jayair",
56+
"fwang",
57+
"adamdotdevin",
58+
"iamdavidhill",
59+
"opencode-agent[bot]",
60+
"R44VC0RP",
61+
]
62+
4963
export const Script = {
5064
get channel() {
5165
return CHANNEL
@@ -59,5 +73,8 @@ export const Script = {
5973
get release() {
6074
return env.OPENCODE_RELEASE
6175
},
76+
get team() {
77+
return team
78+
},
6279
}
6380
console.log(`opencode script`, JSON.stringify(Script, null, 2))

script/beta.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env bun
22

33
import { $ } from "bun"
4-
import { Script } from "@opencode-ai/script"
54

65
interface PR {
76
number: number
@@ -32,28 +31,12 @@ Please resolve this issue to include this PR in the next beta release.`
3231
}
3332

3433
async function main() {
35-
console.log("Fetching open PRs with beta label from team members...")
34+
console.log("Fetching open PRs with beta label...")
3635

37-
const allPrs: PR[] = []
38-
for (const member of Script.team) {
39-
try {
40-
const stdout =
41-
await $`gh pr list --state open --author ${member} --label beta --json number,title,author,labels --limit 100`.text()
42-
const memberPrs: PR[] = JSON.parse(stdout)
43-
allPrs.push(...memberPrs)
44-
} catch {
45-
// Skip member on error
46-
}
47-
}
48-
49-
const seen = new Set<number>()
50-
const prs = allPrs.filter((pr) => {
51-
if (seen.has(pr.number)) return false
52-
seen.add(pr.number)
53-
return true
54-
})
36+
const stdout = await $`gh pr list --state open --label beta --json number,title,author,labels --limit 100`.text()
37+
const prs: PR[] = JSON.parse(stdout)
5538

56-
console.log(`Found ${prs.length} open PRs with beta label from team members`)
39+
console.log(`Found ${prs.length} open PRs with beta label`)
5740

5841
if (prs.length === 0) {
5942
console.log("No team PRs to merge")

script/changelog.ts

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,7 @@
33
import { $ } from "bun"
44
import { createOpencode } from "@opencode-ai/sdk/v2"
55
import { parseArgs } from "util"
6-
7-
export const team = [
8-
"actions-user",
9-
"opencode",
10-
"rekram1-node",
11-
"thdxr",
12-
"kommander",
13-
"jayair",
14-
"fwang",
15-
"adamdotdevin",
16-
"iamdavidhill",
17-
"opencode-agent[bot]",
18-
"R44VC0RP",
19-
]
6+
import { Script } from "@opencode-ai/script"
207

218
type Release = {
229
tag_name: string
@@ -191,7 +178,7 @@ export async function generateChangelog(commits: Commit[], opencode: Awaited<Ret
191178
for (let i = 0; i < commits.length; i++) {
192179
const commit = commits[i]!
193180
const section = getSection(commit.areas)
194-
const attribution = commit.author && !team.includes(commit.author) ? ` (@${commit.author})` : ""
181+
const attribution = commit.author && !Script.team.includes(commit.author) ? ` (@${commit.author})` : ""
195182
const entry = `- ${summaries[i]}${attribution}`
196183

197184
if (!grouped.has(section)) grouped.set(section, [])
@@ -222,7 +209,7 @@ export async function getContributors(from: string, to: string) {
222209
const title = message.split("\n")[0] ?? ""
223210
if (title.match(/^(ignore:|test:|chore:|ci:|release:)/i)) continue
224211

225-
if (login && !team.includes(login)) {
212+
if (login && !Script.team.includes(login)) {
226213
if (!contributors.has(login)) contributors.set(login, new Set())
227214
contributors.get(login)!.add(title)
228215
}

0 commit comments

Comments
 (0)