ci: handle case where generate.yml fails better
This commit is contained in:
parent
ecc5050838
commit
8d11df1b3b
3 changed files with 37 additions and 17 deletions
|
|
@ -3,12 +3,3 @@
|
|||
import { $ } from "bun"
|
||||
|
||||
await $`bun run prettier --ignore-unknown --write .`
|
||||
|
||||
if (process.env["CI"] && (await $`git status --porcelain`.text())) {
|
||||
await $`git config --local user.email "action@github.com"`
|
||||
await $`git config --local user.name "GitHub Action"`
|
||||
await $`git add -A`
|
||||
await $`git commit -m "chore: format code"`
|
||||
const branch = process.env["PUSH_BRANCH"]
|
||||
await $`git push origin HEAD:${branch} --no-verify`
|
||||
}
|
||||
|
|
|
|||
12
script/generate.ts
Normal file
12
script/generate.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#!/usr/bin/env bun
|
||||
|
||||
import { $ } from "bun"
|
||||
|
||||
// Build SDK
|
||||
await $`bun ./packages/sdk/js/script/build.ts`
|
||||
|
||||
// Generate openapi.json
|
||||
await $`bun dev generate > ../sdk/openapi.json`.cwd("packages/opencode")
|
||||
|
||||
// Format
|
||||
await $`./script/format.ts`
|
||||
Loading…
Add table
Add a link
Reference in a new issue