From 67b38ed3334b801edaca34bced52cd7e55f1dced Mon Sep 17 00:00:00 2001 From: seveibar Date: Mon, 19 Aug 2024 12:20:10 -0700 Subject: [PATCH] new formatbot that has special behavior for forks (only checks without autofix) --- .github/workflows/formatbot.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/formatbot.yml b/.github/workflows/formatbot.yml index 8f024d2..f1c4d69 100644 --- a/.github/workflows/formatbot.yml +++ b/.github/workflows/formatbot.yml @@ -37,20 +37,27 @@ jobs: - name: Install @biomejs/biome run: npm install @biomejs/biome@${{ steps.get-biome-version.outputs.BIOME_VERSION }} - - name: Run formatter + - name: Run Formatter and autofix + if: steps.check_fork.outputs.is_fork == 'false' run: npx @biomejs/biome format . --write + - name: Format Check (cannot autofix against forks) + if: steps.check_fork.outputs.is_fork == 'true' + run: npx @biomejs/biome format . + - name: Restore lock files + if: steps.check_fork.outputs.is_fork == 'false' run: | git checkout -- *lock.json || true git checkout -- *.lock || true git checkout -- *.lockb || true - name: Commit changes + if: steps.check_fork.outputs.is_fork == 'false' uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: "formatbot: Automatically format code" branch: ${{ github.head_ref }} commit_user_name: tscircuitbot commit_user_email: tscircuitbot@users.noreply.github.com - commit_author: tscircuitbot + commit_author: tscircuitbot \ No newline at end of file