Skip to content

ci: Add locked-in tool; fix violations #765

ci: Add locked-in tool; fix violations

ci: Add locked-in tool; fix violations #765

Workflow file for this run

name: Prettier
on:
pull_request:
push:
branches:
- main
- dev
# Cancel in-progress runs on new commits to same PR/branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: {}
jobs:
prettier:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
with:
bun-version: "1.3.4"
- name: Install dependencies
run: bun ci
- name: Verify Prettier version
run: |
EXPECTED_VERSION=$(node -p "require('./package.json').devDependencies.prettier")
ACTUAL_VERSION=$(bunx prettier --version)
echo "Expected Prettier version (from package.json): $EXPECTED_VERSION"
echo "Actual Prettier version: $ACTUAL_VERSION"
if [ "$EXPECTED_VERSION" != "$ACTUAL_VERSION" ]; then
echo "Error: Prettier version mismatch!"
echo "bun.lock is out of sync with package.json — regenerate it and commit the result"
exit 1
fi
echo "✓ Prettier version matches"
- name: Run Prettier check
run: |
bun run prettier:check || {
echo "Prettier found code style issues."
echo
echo "To fix locally, from the repo root run:"
echo " bun run prettier"
echo
echo "Then commit the changes and push to rerun this check."
exit 1
}