ci: check oxfmt on pull requests

This commit is contained in:
Patrick Erichsen
2026-04-28 18:16:32 -07:00
parent c1f167721b
commit 4701c555f3
2 changed files with 21 additions and 0 deletions
+20
View File
@@ -12,6 +12,8 @@ jobs:
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: oven-sh/setup-bun@e3914758a49697077f7bcd190d36582a61667aad
with:
@@ -22,6 +24,24 @@ jobs:
- name: Peer deps
run: bun run check:peers
- name: Format
if: github.event_name == 'pull_request'
run: |
mapfile -d '' changed_files < <(
git diff --name-only --diff-filter=ACMR -z \
"${{ github.event.pull_request.base.sha }}" \
"${{ github.event.pull_request.head.sha }}" \
-- \
'*.css' '*.js' '*.jsx' '*.json' '*.md' '*.mjs' '*.ts' '*.tsx' '*.yaml' '*.yml'
)
if (( ${#changed_files[@]} == 0 )); then
echo "No changed files supported by oxfmt."
exit 0
fi
bun run format:check -- "${changed_files[@]}"
- name: Lint
run: bun run lint
+1
View File
@@ -15,6 +15,7 @@
"dev": "bun --bun vite dev --port 3000",
"docs:list": "bun scripts/docs-list.ts",
"format": "oxfmt --write",
"format:check": "oxfmt --check",
"install:local-hooks": "bun scripts/install-git-hooks.mjs",
"lint": "bun run lint:oxlint",
"lint:fix": "oxlint --type-aware --tsconfig ./tsconfig.oxlint.json ./src ./convex ./packages/clawhub/src ./packages/schema/src --fix && bun run format",