Comments (9)
Alright, there is now v4.3 which has the bugfix and a note for the workaround in the readme. Thanks for everyone who hel'ped and supported here! All repos using the action with the @master
or just plain prettier_action
without a version specified don't need to change anything. Everyone else who pinned an earlier version should either change their workflow to the new version or add the workaround.
from prettier_action.
Version 3.3 appears to be the latest version that is not affected.
from prettier_action.
A workaround for this bug: pin npm to version 8 in your job (if it's possible)
- name: Install npm v8
run: npm i -g npm@8
- name: Check code-style
uses: creyD/[email protected]
with:
dry: true
prettier_options: --check **/*.{md,yml}
from prettier_action.
Hi all! Thanks for the quick and efficient coordination. As I can see you already worked out a workaround. I can also add it to the readme to support struggling users. Would it be a good idea to pin the npm version in the action? Or what ways forward should we think of?
from prettier_action.
I've done some debugging:
- it seems
prettier
is not found because$PATH
is off:echo PATH=$PATH PATH=Unknown command: "bin" To see a list of supported npm commands, run: npm help:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
- running
npm help
confirmsnpm bin
is not availablenpm <command> Usage: npm install install all the dependencies in your project npm install <foo> add the <foo> dependency to your project npm test run this project's tests npm run <foo> run the script named <foo> npm <command> -h quick help on <command> npm -l display usage info for all commands npm help <term> search for help on <term> npm help npm more involved overview All commands: access, adduser, audit, bugs, cache, ci, completion, config, dedupe, deprecate, diff, dist-tag, docs, doctor, edit, exec, explain, explore, find-dupes, fund, get, help, hook, init, install, install-ci-test, install-test, link, ll, login, logout, ls, org, outdated, owner, pack, ping, pkg, prefix, profile, prune, publish, query, rebuild, repo, restart, root, run-script, search, set, shrinkwrap, star, stars, start, stop, team, test, token, uninstall, unpublish, unstar, update, version, view, whoami Specify configs in the ini-formatted file: /home/runner/.npmrc or on the command line via: npm <command> --key=value More configuration info: npm help config Configuration fields: npm help 7 config [email protected] /usr/local/lib/node_modules/npm
- check
npm
versionnpm version 9.3.1
- In
npm v9
npm bin
is removed: https://github.blog/changelog/2022-10-24-npm-v9-0-0-released/#%E2%9A%A0%EF%B8%8F-notable-breaking-changes $PATH
is set bynpm bin
inLine 64 in dc62bca
Conclusion
It seems currently this action won't work with npm v9
.
So I've executed prettier
with npm exec prettier
and it worked, step succeeded. I'm not sure if that's the way. In that case though npm install
might be unneeded as according to the docs npm exec
can fetch packages also.
But I'm not too much into Node and npm so I leave this decision for you 😃
from prettier_action.
Same here, workflows using this actions randomly started failing recently with the same error /home/runner/work/_actions/creyD/prettier_action/v4.2/entrypoint.sh: line 74: prettier: command not found
from prettier_action.
Same here: https://github.com/dita-ot/docs/actions/runs/4211604746/jobs/7310061348
from prettier_action.
Here the same issue in multile repo's.
from prettier_action.
Would it be a good idea to pin the npm version in the action? Or what ways forward should we think of?
I think it's a good practice to pin versions when possible, so that the behavior will always be the same. Then when something gets an update, it can be manually updated on the action, making sure that everything's working as excepted
from prettier_action.
Related Issues (20)
- [BUG] Problem running prettier in workflow HOT 5
- [BUG] Doesn't fail on infer parser failed HOT 4
- [BUG] Shouldn't delete node_modules HOT 8
- [BUG] Actions Fails to install/use modules - Cannot find module '@prettier/plugin-php'
- [BUG] Cannot find module 'prettier-plugin-tailwindcss' HOT 11
- [BUG] prettier: command not found HOT 3
- [BUG] Problem --writer HOT 4
- [BUG] Process completed with exit code 1 HOT 5
- [BUG] Example not working. HOT 4
- IDEA: Add push_options parameter HOT 3
- [BUG] Error: Process completed with exit code 1 when using prettier-php HOT 12
- [BUG] Code style issues found, can't reproduce locally HOT 2
- [FEATURE] Format only changed lines not the whole file HOT 1
- [BUG] Should work when package-lock.json is not versioned HOT 3
- [FEATURE] Don't log unchanged files
- [BUG] Dry run fails in spite of the fact that a line length does not exceed 80 chars. HOT 2
- What is status code 128? HOT 5
- Readme out of date
- [FEATURE] Print the `prettier` command to be executed before executing it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prettier_action.