summaryrefslogtreecommitdiffhomepage
path: root/script/format.ts
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-09-09 23:47:47 -0400
committerDax Raad <[email protected]>2025-09-09 23:47:47 -0400
commite53fb7f8eda760b9d39479a2038720d54a434629 (patch)
tree2cd58463253e72d0331bb88d2b9316f9bcd86997 /script/format.ts
parentb05cbc910130ed9924f33ece3b5a70885f2f126d (diff)
downloadopencode-e53fb7f8eda760b9d39479a2038720d54a434629.tar.gz
opencode-e53fb7f8eda760b9d39479a2038720d54a434629.zip
ci: format
Diffstat (limited to 'script/format.ts')
-rwxr-xr-xscript/format.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/script/format.ts b/script/format.ts
new file mode 100755
index 000000000..d80820409
--- /dev/null
+++ b/script/format.ts
@@ -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 "[email protected]"`
+ await $`git config --local user.name "GitHub Action"`
+ await $`git add -A`
+ await $`git commit -m "chore: format code"`
+ await $`git push`
+}