diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ac1801..dc7c334 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,14 +22,21 @@ jobs: prettier: name: Prettier runs-on: ubuntu-latest - steps: - uses: actions/checkout@v2 + + - uses: actions/setup-node@v1 with: - ref: ${{ github.head_ref }} - fetch-depth: 0 + node-version: '14' + registry-url: 'https://registry.npmjs.org' + + - run: yarn install --frozen-lockfile + - run: yarn run prettier:check - - name: Prettify code - uses: creyD/prettier_action@v3.1 + - if: ${{ failure() }} + uses: unsplash/comment-on-pr@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - only_changed: True + msg: "Prettier check failed. You need to run `yarn run prettier:write` before committing." + check_for_duplicate_msg: true