Skip to content

existence

existence #251

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: 20
# This installs all dependencies, but if we use "npm install -g prettier",
# then prettier won't pick up the project's .prettierrc file.
- name: Install dependencies
run: npm ci
- name: Check formatting
run: |
npm run prettier:check
- 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