1 changed files with 46 additions and 0 deletions
@ -0,0 +1,46 @@ |
|||
name: Biome Format |
|||
|
|||
on: |
|||
push: |
|||
branches: [ main, master ] |
|||
pull_request: |
|||
branches: [ main, master ] |
|||
workflow_dispatch: |
|||
|
|||
jobs: |
|||
format: |
|||
runs-on: ubuntu-latest |
|||
|
|||
permissions: |
|||
# We need to give the default GITHUB_TOKEN write permission to commit and push |
|||
contents: write |
|||
|
|||
steps: |
|||
- uses: actions/checkout@v4 |
|||
with: |
|||
ref: ${{ github.head_ref }} |
|||
|
|||
- name: Setup Node.js |
|||
uses: actions/setup-node@v4 |
|||
with: |
|||
node-version: '20' |
|||
|
|||
- name: Install Biome |
|||
run: npm install --global @biomejs/biome |
|||
|
|||
- name: Format with Biome |
|||
run: biome format --write . |
|||
|
|||
- name: Check for changes |
|||
id: git-check |
|||
run: | |
|||
git diff --exit-code || echo "changes=true" >> $GITHUB_OUTPUT |
|||
|
|||
- name: Commit changes |
|||
if: steps.git-check.outputs.changes == 'true' |
|||
run: | |
|||
git config --local user.email "github-actions[bot]@users.noreply.github.com" |
|||
git config --local user.name "github-actions[bot]" |
|||
git add -A |
|||
git commit -m "chore: format code" |
|||
git push |
|||
Loading…
Reference in new issue