prettier_action
prettier_action copied to clipboard
[BUG] Problem running prettier in workflow
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?
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.
I suppose you could try with the option --write
. As long as dry=True
it doesn't commit the changes.
Unfortunately that didn't work either:
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.
running same version locally and on ci, still fails.