From ef9c93cbf9189103b7e2ae237ca174fab458baf5 Mon Sep 17 00:00:00 2001 From: Ahmed Bouhuolia Date: Sun, 31 May 2026 23:33:30 +0200 Subject: [PATCH] ci: add Prettier format check GitHub Action Adds a format-check workflow that runs `pnpm run format:check` (Lerna fans out to all packages with the script) on pushes to main/develop and all PRs. Also adds the missing `format:check` script to the server package so Lerna picks it up alongside the existing webapp script. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/format-check.yml | 65 ++++++++++++++++++++++++++++++ packages/server/package.json | 1 + 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/format-check.yml diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 000000000..a4485153a --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,65 @@ +name: Format Check + +on: + push: + branches: + - main + - develop + paths: + - '**.ts' + - '**.tsx' + - '**.js' + - '**.jsx' + - '**.json' + - '**.md' + - '**/.prettierrc' + - '**/prettier.config.*' + - 'pnpm-lock.yaml' + - 'package.json' + - 'packages/*/package.json' + - '.github/workflows/format-check.yml' + pull_request: + paths: + - '**.ts' + - '**.tsx' + - '**.js' + - '**.jsx' + - '**.json' + - '**.md' + - '**/.prettierrc' + - '**/prettier.config.*' + - 'pnpm-lock.yaml' + - 'package.json' + - 'packages/*/package.json' + - '.github/workflows/format-check.yml' + +defaults: + run: + shell: 'bash' + +jobs: + format-check: + name: Prettier Format Check + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Run format check + run: pnpm run format:check diff --git a/packages/server/package.json b/packages/server/package.json index 07ccb69d2..982dcb5eb 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -8,6 +8,7 @@ "scripts": { "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", "start:dev": "nest start --watch", "start:debug": "nest start --debug --watch",