From 187a479bd53857f30b15ab1fea61951ae09f59bb Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Wed, 15 Jul 2026 15:57:42 +0200 Subject: [PATCH] fix(ci): scope format check to only PR-changed files --- .github/workflows/ci.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b9246059..afc4ff903 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,9 +81,19 @@ jobs: - name: Copy environment defaults run: cp .env.example .env - - name: Check formatting in affected workspaces + - name: Get changed files + id: changed + if: github.event_name == 'pull_request' + env: + BASE_REF: ${{ github.base_ref }} + run: | + git diff --name-only --diff-filter=ACMR "origin/${BASE_REF}...HEAD" -- '*.ts' '*.tsx' '*.js' '*.jsx' > /tmp/changed-files + echo "count=$(wc -l < /tmp/changed-files | tr -d '[:space:]')" >> $GITHUB_OUTPUT + + - name: Check formatting on changed files + if: steps.changed.outputs.count != '0' continue-on-error: true - run: pnpm turbo run format --affected --continue -- --check + run: xargs -r -a /tmp/changed-files pnpm exec oxfmt --check - name: Lint, typecheck, and build affected workspaces run: pnpm turbo run lint typecheck build --affected --continue=dependencies-successful