mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 08:52:21 +00:00
ci: check oxfmt on pull requests
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user