Add support to skip install when CI=true
See original GitHub issueContext: Setting up Husky in CI is usually pointless, git
usually used as read-only, not making commits in CI. But having .git/hooks
initialized with husky can cause trouble if the next CI job is without node_modules
and CI Runner has not provided clean .git
.
Disabling husky install can be done with testing for $CI
value:
"scripts": {
- "prepare": "husky install"
+ "prepare": "test -n \"$CI\" || husky install"
}
However, that is not portable (no POSIX shell on windows), so perhaps add --skip-ci
option to husky install
command:
"scripts": {
- "prepare": "husky install"
+ "prepare": "husky install --skip-ci"
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Treating warnings as errors because process.env.CI = true ...
I added env variable in .travis.yml file. env: process.env.CI : false. Still its showing ...
Read more >pnpm install
pnpm install is used to install all dependencies for a project. In a CI environment, installation fails if a lockfile is present but...
Read more >Running Tests | Create React App
To create tests, add it() (or test() ) blocks with the name of the test and ... To install react-testing-library and jest-dom ,...
Read more >Types of shells supported by GitLab Runner
GitLab Runner implements a few shell script generators that allow executing builds on different systems. Overview. The shell scripts contain commands to ...
Read more >How to configure a pipeline on Azure Devops to build and ...
Go to Azure Devops / pipelines and add a new pipeline. Select your yaml supported repository provider and set up a Node.js project....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Indeed it is! thanks.
If
node_modules
is there, installis-ci
no?