diff --git a/package.json b/package.json index 93ec4e85d67..c6e955342e8 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "yargs": "^17.0.1" }, "scripts": { - "prepare": "gulp prepare && husky && playwright install --with-deps", + "prepare": "gulp prepare && husky && node scripts/isCI.js || playwright install --with-deps", "start": "node server.js", "start-public": "node server.js --public", "build": "gulp build", diff --git a/scripts/isCI.js b/scripts/isCI.js new file mode 100644 index 00000000000..559a2e71535 --- /dev/null +++ b/scripts/isCI.js @@ -0,0 +1,12 @@ +// Logic and values based on is-ci https://github.com/watson/is-ci/blob/master/bin.js +// which uses ci-info under the hood https://github.com/watson/ci-info/blob/master/index.js +// This just extracts the specific parts we need without adding more dependencies + +const { env } = process; + +const isCI = !!( + env.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false' + env.CI // GitHub CI +); + +process.exit(isCI ? 0 : 1);