opencode/script/format.ts

15 lines
453 B
TypeScript
Raw Normal View History

2025-09-09 23:47:47 -04:00
#!/usr/bin/env bun
import { $ } from "bun"
2025-11-06 13:03:02 -05:00
await $`bun run prettier --ignore-unknown --write .`
2025-09-09 23:47:47 -04:00
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"`
2025-12-07 21:48:41 -06:00
const branch = process.env["PUSH_BRANCH"]
await $`git push origin HEAD:${branch} --no-verify`
2025-09-09 23:47:47 -04:00
}