Skip to content

Commit 3fae1ac

Browse files
authored
fix: don't read envs when explicitly not in CI (#140)
1 parent 688b9c2 commit 3fae1ac

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

index.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,24 @@ exports.name = null
1515
exports.isPR = null
1616
exports.id = null
1717

18-
vendors.forEach(function (vendor) {
19-
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
20-
const isCI = envs.every(function (obj) {
21-
return checkEnv(obj)
22-
})
18+
if (env.CI !== 'false') {
19+
vendors.forEach(function (vendor) {
20+
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
21+
const isCI = envs.every(function (obj) {
22+
return checkEnv(obj)
23+
})
2324

24-
exports[vendor.constant] = isCI
25+
exports[vendor.constant] = isCI
2526

26-
if (!isCI) {
27-
return
28-
}
27+
if (!isCI) {
28+
return
29+
}
2930

30-
exports.name = vendor.name
31-
exports.isPR = checkPR(vendor)
32-
exports.id = vendor.constant
33-
})
31+
exports.name = vendor.name
32+
exports.isPR = checkPR(vendor)
33+
exports.id = vendor.constant
34+
})
35+
}
3436

3537
exports.isCI = !!(
3638
env.CI !== 'false' && // Bypass all checks if CI env is explicitly set to 'false'

0 commit comments

Comments
 (0)