@@ -7,6 +7,39 @@ const {warnIfUsingSecretsWithoutTheBrefDependency} = require('./plugin/secrets')
77const fs = require ( 'fs' ) ;
88const path = require ( 'path' ) ;
99
10+ const ciEnvironmentVariables = [
11+ 'BUILD_ID' , // Jenkins, Cloudbees
12+ 'BUILD_NUMBER' , // Jenkins, TeamCity
13+ 'CI' , // Travis CI, CircleCI, GitLab CI, etc.
14+ 'CI_APP_ID' , // Appflow
15+ 'CI_BUILD_ID' , // Appflow
16+ 'CI_BUILD_NUMBER' , // Appflow
17+ 'CI_NAME' , // Codeship and others
18+ 'CONTINUOUS_INTEGRATION' , // Travis CI, Cirrus CI
19+ 'RUN_ID' , // TaskCluster, dsari
20+ 'GITHUB_ACTIONS' ,
21+ 'GITLAB_CI' ,
22+ 'CIRCLECI' ,
23+ 'TRAVIS' ,
24+ 'APPVEYOR' ,
25+ 'BUILDKITE' ,
26+ 'CODEBUILD_BUILD_ARN' ,
27+ 'TF_BUILD' , // Azure Pipelines
28+ 'TEAMCITY_VERSION' ,
29+ 'JENKINS_URL' ,
30+ 'BITBUCKET_COMMIT' ,
31+ 'DRONE' ,
32+ 'NETLIFY' ,
33+ 'VERCEL' ,
34+ 'CF_PAGES' , // Cloudflare Pages
35+ 'RENDER' ,
36+ 'BITRISE_IO' ,
37+ ] ;
38+
39+ function isCiEnvironment ( env ) {
40+ return env . CI !== 'false' && ciEnvironmentVariables . some ( ( name ) => Boolean ( env [ name ] ) ) ;
41+ }
42+
1043// Disable `sls` promoting the Serverless Console because it's not compatible with PHP, it's tripping users up
1144if ( ! process . env . SLS_NOTIFICATIONS_MODE ) {
1245 process . env . SLS_NOTIFICATIONS_MODE = 'upgrades-only' ;
@@ -281,10 +314,6 @@ class ServerlessPlugin {
281314 /** @type {{ get: (string) => string } } */
282315 // @ts -ignore
283316 const userConfig = require . main . require ( '@serverless/utils/config' ) ;
284- /** @type {typeof import('ci-info') } */
285- // @ts -ignore
286- const ci = require . main . require ( 'ci-info' ) ;
287-
288317 let command = 'unknown' ;
289318 if ( this . serverless . processedInput && this . serverless . processedInput . commands ) {
290319 command = this . serverless . processedInput . commands . join ( ' ' ) ;
@@ -301,7 +330,7 @@ class ServerlessPlugin {
301330 cli : 'sls' ,
302331 v : 2 , // Bref version
303332 c : command ,
304- ci : ci . isCI ,
333+ ci : isCiEnvironment ( process . env ) ,
305334 install : userConfig . get ( 'meta.created_at' ) ,
306335 uid : userConfig . get ( 'frameworkId' ) , // anonymous user ID created by the Serverless Framework
307336 tz : timezone ,
0 commit comments