Skip to content

Commit

Permalink
Merge pull request #27 from tscircuit/fork-beh
Browse files Browse the repository at this point in the history
new formatbot that has special behavior for forks (only checks without autofix)
  • Loading branch information
seveibar authored Aug 19, 2024
2 parents e7fd0fb + 67b38ed commit d5d2082
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/formatbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <tscircuitbot@users.noreply.github.com>
commit_author: tscircuitbot <tscircuitbot@users.noreply.github.com>

0 comments on commit d5d2082

Please sign in to comment.