name: Prettier on: [pull_request, push] jobs: prettier: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 with: ref: ${{ github.head_ref }} - name: Setup Node uses: actions/setup-node@v3 with: node-version: 16 cache: 'yarn' - name: Install Dependencies run: yarn - name: Prettify code run: yarn prettier --write '**/*.{ts,md}' - name: Commit changes uses: stefanzweifel/git-auto-commit-action@v4 with: commit_message: Apply formatting changes branch: ${{ github.head_ref }}