question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support to skip install when CI=true

See original GitHub issue

Context: 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
glensccommented, Mar 14, 2022

at the time “prepare” script is present, husky and node_modules are there

If node_modules is there, install is-ci no?

Indeed it is! thanks.

0reactions
mondejacommented, Mar 14, 2022

at the time “prepare” script is present, husky and node_modules are there

If node_modules is there, install is-ci no?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found