Skip to content

auto: format code

auto: format code #2

Workflow file for this run

name: format
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- uses: oven-sh/setup-bun@v2
- run: bunx prettier --write "**/*.{js,jsx,ts,tsx,json,md,yaml,yml}"
- run: git diff --exit-code || echo "has_changes=true" >> $GITHUB_OUTPUT
- if: steps.git-check.outputs.has_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 "auto: format code with prettier"
git push