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