GeezerVison is showing github.com — ci: centralize team list in @opencode-ai/script package and use beta … · simonklee/opencode@f390ac2
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: packages/script/src/index.ts +17Lines changed: 17 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,6 +46,20 @@ const VERSION = await (async () => { | 46 | 46 | return `${major}.${minor}.${patch + 1}` | 47 | 47 | })() | 48 | 48 |
| | 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 | + | 49 | 63 | export const Script = { | 50 | 64 | get channel() { | 51 | 65 | return CHANNEL | @@ -59,5 +73,8 @@ export const Script = { | 59 | 73 | get release() { | 60 | 74 | return env.OPENCODE_RELEASE | 61 | 75 | }, | | 76 | + get team() { | | 77 | + return team | | 78 | + }, | 62 | 79 | } | 63 | 80 | console.log(`opencode script`, JSON.stringify(Script, null, 2)) |
Collapse file Copy file name to clipboardExpand all lines: script/beta.ts +4-21Lines changed: 4 additions & 21 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #!/usr/bin/env bun | 2 | 2 |
| 3 | 3 | import { $ } from "bun" | 4 | | -import { Script } from "@opencode-ai/script" | 5 | 4 |
| 6 | 5 | interface PR { | 7 | 6 | number: number | @@ -32,28 +31,12 @@ Please resolve this issue to include this PR in the next beta release.` | 32 | 31 | } | 33 | 32 |
| 34 | 33 | async function main() { | 35 | | - console.log("Fetching open PRs with beta label from team members...") | | 34 | + console.log("Fetching open PRs with beta label...") | 36 | 35 |
| 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) | 55 | 38 |
| 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`) | 57 | 40 |
| 58 | 41 | if (prs.length === 0) { | 59 | 42 | console.log("No team PRs to merge") | |
Collapse file Copy file name to clipboardExpand all lines: script/changelog.ts +3-16Lines changed: 3 additions & 16 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 | import { $ } from "bun" | 4 | 4 | import { createOpencode } from "@opencode-ai/sdk/v2" | 5 | 5 | 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" | 20 | 7 |
| 21 | 8 | type Release = { | 22 | 9 | tag_name: string | @@ -191,7 +178,7 @@ export async function generateChangelog(commits: Commit[], opencode: Awaited<Ret | 191 | 178 | for (let i = 0; i < commits.length; i++) { | 192 | 179 | const commit = commits[i]! | 193 | 180 | 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})` : "" | 195 | 182 | const entry = `- ${summaries[i]}${attribution}` | 196 | 183 |
| 197 | 184 | if (!grouped.has(section)) grouped.set(section, []) | @@ -222,7 +209,7 @@ export async function getContributors(from: string, to: string) { | 222 | 209 | const title = message.split("\n")[0] ?? "" | 223 | 210 | if (title.match(/^(ignore:|test:|chore:|ci:|release:)/i)) continue | 224 | 211 |
| 225 | | - if (login && !team.includes(login)) { | | 212 | + if (login && !Script.team.includes(login)) { | 226 | 213 | if (!contributors.has(login)) contributors.set(login, new Set()) | 227 | 214 | contributors.get(login)!.add(title) | 228 | 215 | } | |
|