prettier_action icon indicating copy to clipboard operation
prettier_action copied to clipboard

[BUG] Problem running prettier in workflow

Open AbdullahShahzadd opened this issue 2 years ago • 5 comments

What exactly happened? The following workflow configuration resulted in error: Problem running prettier with --check **/*.{js,ts,json,yaml,md}. I am uncertain if this is the right place to ask for help, so if somewhere else would be more appropriate please let me know.

on:
  pull_request:
  push:
    branches:
      - main

jobs:

  prettier:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          ref: ${{ github.head_ref }}
          fetch-depth: 0

      - name: Prettify code
        uses: creyD/[email protected]
        with:
          dry: True
          prettier_options: --check **/*.{js,ts,json,yaml,md}

What should've happened? Should have resulted in a pass as it does locally and has done in the past.

How did it look? image

AbdullahShahzadd avatar Jan 12 '23 18:01 AbdullahShahzadd

A colleague suggested that my local version of prettier might be different from the version used in this workflow. I have ^2.6.2 and latest is 2.8.2 so that should be ok but I modified the config to use prettier_version: 2.6.2 and it didn't fix the issue. The code causing the issue seems to be here. Any suggestions would be appreciated.

AbdullahShahzadd avatar Jan 13 '23 14:01 AbdullahShahzadd

I suppose you could try with the option --write. As long as dry=True it doesn't commit the changes.

creyD avatar Jan 23 '23 12:01 creyD

Unfortunately that didn't work either: image

AbdullahShahzadd avatar Jan 23 '23 14:01 AbdullahShahzadd

It seems that we are getting a similar issue. When I install the repo locally and run prettier, it is fine. It fails in pipeline. All versions from 4.3 down fail until 3.3.

ackvf avatar Jul 05 '23 19:07 ackvf

running same version locally and on ci, still fails.

raynirola avatar Mar 22 '24 10:03 raynirola