creyD/prettier_action

[BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php'

BRAiNCHiLD95 opened this issue · 0 comments

What exactly happened?

Workflow fails with error -> Cannot find module '@prettier/plugin-php'

What should've happened?
The actions should've correctly formatted all files in the repo.

How did it look?

image

Run creyD/prettier_action@v4.2
  with:
    prettier_plugins: @prettier/plugin-php
    prettier_options: --write **/*.{js,css,php}
    only_changed: false
    commit_message: Prettified Code!
    same_commit: false
    file_pattern: *
    dry: false
    prettier_version: false
    working_directory: false
    github_token: ***
Run PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/runner/work/_actions/creyD/prettier_action/v4.[2](https://github.com/vidtutech/vidtu-client/actions/runs/4091323125/jobs/7055324811#step:3:2)/entrypoint.sh
  PATH=$(cd $GITHUB_ACTION_PATH; npm bin):$PATH /home/runner/work/_actions/creyD/prettier_action/v[4](https://github.com/vidtutech/vidtu-client/actions/runs/4091323125/jobs/7055324811#step:3:4).2/entrypoint.sh
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    INPUT_COMMIT_MESSAGE: Prettified Code!
    INPUT_COMMIT_DESCRIPTION: 
    INPUT_SAME_COMMIT: false
    INPUT_COMMIT_OPTIONS: 
    INPUT_FILE_PATTERN: *
    INPUT_PRETTIER_OPTIONS: --write **/*.{js,css,php}
    INPUT_DRY: false
    INPUT_PRETTIER_VERSION: false
    INPUT_ONLY_CHANGED: false
    INPUT_PRETTIER_PLUGINS: @prettier/plugin-php
    INPUT_WORKING_DIRECTORY: false
    INPUT_GITHUB_TOKEN: ***
  
Installing prettier...
Checking plugin: @prettier/plugin-php
Prettifying files...
Files:
Error:  Cannot find module '@prettier/plugin-php'
Error:  Require stack:
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/index.js
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/cli.js
Error:  - /home/runner/work/_actions/creyD/prettier_action/v4.2/node_modules/prettier/bin-prettier.js
Problem running prettier with --write **/*.{js,css,php}
Error: Process completed with exit code 1.

And this is the .prettierrc file in my repo -

{
	"semi": true,
	"useTabs": true,
	"tabWidth": 4,
	"printWidth": 100,
	"singleQuote": true,
	"quoteProps": "consistent",
	"trailingComma": "es5",
	"jsxSingleQuote": true,
	"bracketSpacing": true,
	"bracketSameLine": true,
	"arrowParens": "always",
	"singleAttributePerLine": true,
	"plugins": ["@prettier/plugin-php"],
	"phpVersion": "8.1",
	"braceStyle": "1tbs",
}

Other notes -
The plugins array in the .prettierrc is the latest change that I can think of. But I need that to get VSCode to use prettier locally.