inside-ci/index.js
Jonatan Nilsson afac31914a
Some checks failed
/ deploy (push) Failing after 15s
Trim the fat and fix typings
Clean the code a bit.
Move comments to test to decrease dependency size
Minify package.json for extra.
2024-11-19 00:11:46 +00:00

12 lines
338 B
JavaScript
Executable file

#!/usr/bin/env node
module.exports.insideCi = function insideCi() {
// Bail out if this is specifically overwritten to false.
if (process.env.CI === 'false') return false
return !!['CI','CI_APP_ID','BUILD_NUMBER','CI_NAME','RUN_ID'].some(x => process.env[x])
}
if (require.main === module) {
process.exit(insideCi() ? 0 : 1)
}