summaryrefslogtreecommitdiffhomepage
path: root/script/publish.ts
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-11-28 15:44:21 -0600
committerAiden Cline <[email protected]>2025-11-28 15:44:21 -0600
commit753443b16f2673e2d8933e9a18bad05414295379 (patch)
tree358405f4c0d0b31bb67c6106b645dd0e13f8c32e /script/publish.ts
parent33c63be980ce2040bee45a5a733aba67121d61e8 (diff)
downloadopencode-753443b16f2673e2d8933e9a18bad05414295379.tar.gz
opencode-753443b16f2673e2d8933e9a18bad05414295379.zip
ci: add community contributors to the changelog
Diffstat (limited to 'script/publish.ts')
-rwxr-xr-xscript/publish.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/script/publish.ts b/script/publish.ts
index 364a1d217..f29b29cfc 100755
--- a/script/publish.ts
+++ b/script/publish.ts
@@ -73,6 +73,44 @@ if (!Script.preview) {
console.log(notes.join("\n"))
console.log("-----------------------------")
opencode.server.close()
+
+ // Get contributors
+ const team = [
+ "actions-user",
+ "opencode",
+ "rekram1-node",
+ "thdxr",
+ "kommander",
+ "jayair",
+ "fwang",
+ "adamdotdevin",
+ "opencode-agent[bot]",
+ ]
+ const compare =
+ await $`gh api "/repos/sst/opencode/compare/v${previous}...HEAD" --jq '.commits[] | {login: .author.login, message: .commit.message}'`.text()
+ const contributors = new Map<string, string[]>()
+
+ for (const line of compare.split("\n").filter(Boolean)) {
+ const { login, message } = JSON.parse(line) as { login: string | null; message: string }
+ const title = message.split("\n")[0] ?? ""
+ if (title.match(/^(ignore:|test:|chore:|ci:|release:)/i)) continue
+
+ if (login && !team.includes(login)) {
+ if (!contributors.has(login)) contributors.set(login, [])
+ contributors.get(login)?.push(title)
+ }
+ }
+
+ if (contributors.size > 0) {
+ notes.push("")
+ notes.push(`**Thank you to ${contributors.size} community contributor${contributors.size > 1 ? "s" : ""}:**`)
+ for (const [username, userCommits] of contributors) {
+ notes.push(`- @${username}:`)
+ for (const commit of userCommits) {
+ notes.push(` - ${commit}`)
+ }
+ }
+ }
}
const pkgjsons = await Array.fromAsync(