Skip to content

Commit 3829056

Browse files
authored
ci: gemini 3 flash doesnt exist in pinned cicd version (anomalyco#5776)
1 parent 8b5cea7 commit 3829056

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
5656
- name: Install OpenCode
5757
if: inputs.bump || inputs.version
58-
run: bun i -g opencode-ai@1.0.143
58+
run: bun i -g opencode-ai@1.0.169
5959

6060
- name: Login to GitHub Container Registry
6161
uses: docker/login-action@v3

script/changelog.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,23 +185,37 @@ export async function generateChangelog(previous: string, current: string): Prom
185185

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

188+
if (!commits.trim()) {
189+
console.error("No commits found to generate changelog")
190+
}
191+
188192
// Generate changelog via LLM
189193
// different port to not conflict with dev running opencode
190-
const opencode = await createOpencode({ port: 8192 })
191194
let raw: string | undefined
192195
try {
193-
const session = await opencode.client.session.create()
194-
raw = await opencode.client.session
195-
.prompt({
196-
path: { id: session.data!.id },
196+
const opencode = await createOpencode({ port: 8192 })
197+
try {
198+
const session = await opencode.client.session.create()
199+
if (!session.data?.id) {
200+
console.error("Failed to create session:", session)
201+
throw new Error("Failed to create session")
202+
}
203+
const response = await opencode.client.session.prompt({
204+
path: { id: session.data.id },
197205
body: {
198206
model: { providerID: "opencode", modelID: MODEL },
199207
parts: [{ type: "text", text: buildPrompt(previous, commits) }],
200208
},
201209
})
202-
.then((x) => x.data?.parts?.find((y) => y.type === "text")?.text)
203-
} finally {
204-
opencode.server.close()
210+
if (!response.data?.parts) {
211+
console.error("Empty response from LLM:", response)
212+
}
213+
raw = response.data?.parts?.find((y) => y.type === "text")?.text
214+
} finally {
215+
opencode.server.close()
216+
}
217+
} catch (err) {
218+
console.error("Failed to generate changelog via LLM:", err)
205219
}
206220

207221
const notes = parseChangelog(raw ?? "")

0 commit comments

Comments
 (0)