ci: format

This commit is contained in:
Dax Raad
2025-09-09 23:47:47 -04:00
parent b05cbc9101
commit e53fb7f8ed
3 changed files with 42 additions and 1 deletions

13
script/format.ts Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bun
import { $ } from "bun"
await $`bun run prettier --ignore-unknown --write $(git ls-files)`
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"`
await $`git push`
}