name: Formating
on: pull_request
jobs:
  extract:
    name: prettier
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: set user
        run: |
          git config --global user.name 'GitHub Actions'
          git config --global user.email 'actions@github.com'
      # use node module caching
      - uses: actions/cache@v2
        with:
          path: '**/node_modules'
          key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}

      - name: install packages
        run: corepack enable && yarn install --immutable

      - name: prettier
        run: yarn prettier --check .