Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Install OpenCode
if: inputs.bump || inputs.version
run: bun i -g opencode-ai@1.0.143
run: bun i -g opencode-ai@1.0.169

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
30 changes: 22 additions & 8 deletions script/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,23 +185,37 @@ export async function generateChangelog(previous: string, current: string): Prom

const commits = commitsWithMeta.join("\n")

if (!commits.trim()) {
console.error("No commits found to generate changelog")
}

// Generate changelog via LLM
// different port to not conflict with dev running opencode
const opencode = await createOpencode({ port: 8192 })
let raw: string | undefined
try {
const session = await opencode.client.session.create()
raw = await opencode.client.session
.prompt({
path: { id: session.data!.id },
const opencode = await createOpencode({ port: 8192 })
try {
const session = await opencode.client.session.create()
if (!session.data?.id) {
console.error("Failed to create session:", session)
throw new Error("Failed to create session")
}
const response = await opencode.client.session.prompt({
path: { id: session.data.id },
body: {
model: { providerID: "opencode", modelID: MODEL },
parts: [{ type: "text", text: buildPrompt(previous, commits) }],
},
})
.then((x) => x.data?.parts?.find((y) => y.type === "text")?.text)
} finally {
opencode.server.close()
if (!response.data?.parts) {
console.error("Empty response from LLM:", response)
}
raw = response.data?.parts?.find((y) => y.type === "text")?.text
} finally {
opencode.server.close()
}
} catch (err) {
console.error("Failed to generate changelog via LLM:", err)
}

const notes = parseChangelog(raw ?? "")
Expand Down
Loading