Back to Prettier

Run Prettier on CI

website/versioned_docs/version-stable/ci.md

3.8.3846 B
Original Source

GitHub Actions

To apply autofix for Prettier from GitHub Actions, do the following:

  1. Install the autofix.ci GitHub App.

  2. Make sure you have a pinned version of Prettier installed in your repository.

  3. Create .github/workflows/prettier.yml with following content:

    yaml
    name: autofix.ci
    on:
      pull_request:
      push:
    permissions: {}
    jobs:
      prettier:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: actions/setup-node@v4
          - run: |
              yarn
              yarn prettier . --write
          - uses: autofix-ci/action@v1
            with:
              commit-message: "Apply Prettier format"
    

For more information see autofix.ci website.