Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Problem running prettier in workflow #106

Open
AbdullahShahzadd opened this issue Jan 12, 2023 · 5 comments
Open

[BUG] Problem running prettier in workflow #106

AbdullahShahzadd opened this issue Jan 12, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@AbdullahShahzadd
Copy link

AbdullahShahzadd commented Jan 12, 2023

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/prettier_action@v4.2
        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 AbdullahShahzadd added the bug Something isn't working label Jan 12, 2023
@AbdullahShahzadd
Copy link
Author

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.

@creyD
Copy link
Owner

creyD commented Jan 23, 2023

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

@AbdullahShahzadd
Copy link
Author

Unfortunately that didn't work either:
image

@ackvf
Copy link

ackvf commented Jul 5, 2023

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.

@raynirola
Copy link

running same version locally and on ci, still fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants