name: 'Format'

on: push

jobs:
  format:
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v5
        with:
          token: ${{ secrets.GH_TOKEN }}
      - uses: actions/setup-node@v5
        with:
          node-version: 19
      - run: git pull
      - run: npm ci
      - run: npm run fmt && git --no-pager diff
      - uses: stefanzweifel/git-auto-commit-action@v6
        with:
          commit_message: 'style: re-format / npm run fmt'
