Skip to content

fix formatter2

fix formatter2 #242

name: Verify formatting 🎨
on:
workflow_dispatch:
pull_request:
branches: [main]
permissions:
contents: read
jobs:
formatting:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: npm install
- name: Check formatting
run: |
npm run prettier:check
# - name: Get Prettier version from package-lock.json
# run: |
# PRETTIER_VERSION=$(grep -m 1 'prettier' package-lock.json | cut -d '"' -f 4 | cut -c 2-)
# echo $PRETTIER_VERSION
# - name: Check formatting
# run: |
# npx --yes prettier@$PRETTIER_VERSION . --check --config ./.prettierrc
- name: Fail if formatting check failed
if: failure()
run: |
echo "Formatting check failed. Please format your code according to the project's Prettier configuration."
exit 1