inside-ci/index.js

15 lines
348 B
JavaScript
Raw Permalink Normal View History

2024-11-18 23:57:35 +00:00
#!/usr/bin/env node
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])
2024-11-18 23:57:35 +00:00
}
module.exports.insideCi = insideCi
if (require.main === module) {
process.exit(insideCi() ? 0 : 1)
}