From a95e344fe5d7887b636457a41c0e2a4db9e547f3 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 10 Oct 2021 03:04:01 +1300 Subject: [PATCH] tty: support more CI services in `getColorDepth` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/40385 Refs: https://github.com/sindresorhus/yoctocolors/pull/5 Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Minwoo Jung Reviewed-By: Ruben Bridgewater --- lib/internal/tty.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/internal/tty.js b/lib/internal/tty.js index f8bfe8cf21a32b..5abf0b908b02cc 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -159,8 +159,15 @@ function getColorDepth(env = process.env) { } if (env.CI) { - if ('TRAVIS' in env || 'CIRCLECI' in env || 'APPVEYOR' in env || - 'GITLAB_CI' in env || env.CI_NAME === 'codeship') { + if ([ + 'APPVEYOR', + 'BUILDKITE', + 'CIRCLECI', + 'DRONE', + 'GITHUB_ACTIONS', + 'GITLAB_CI', + 'TRAVIS', + ].some((sign) => sign in env) || env.CI_NAME === 'codeship') { return COLORS_256; } return COLORS_2;