From 9af5816d5e50767b1e227beaa773f97c826b8754 Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 10 Oct 2021 03:04:01 +1300 Subject: [PATCH 1/4] Support more CI services in `getColorDepth` --- lib/internal/tty.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/tty.js b/lib/internal/tty.js index f8bfe8cf21a32b..f58ddcfaad3a34 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -160,7 +160,8 @@ 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') { + 'GITLAB_CI' in env || 'GITHUB_ACTIONS' in env || 'BUILDKITE' in env || + 'DRONE' in env || env.CI_NAME === 'codeship') { return COLORS_256; } return COLORS_2; From eed74692827c69fb8242a45569afc2aa7b7cba6b Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 10 Oct 2021 03:45:00 +1300 Subject: [PATCH 2/4] Update tty.js --- lib/internal/tty.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/internal/tty.js b/lib/internal/tty.js index f58ddcfaad3a34..0cdec90b9f4ad9 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -159,9 +159,15 @@ function getColorDepth(env = process.env) { } if (env.CI) { - if ('TRAVIS' in env || 'CIRCLECI' in env || 'APPVEYOR' in env || - 'GITLAB_CI' in env || 'GITHUB_ACTIONS' in env || 'BUILDKITE' in env || - 'DRONE' in env || env.CI_NAME === 'codeship') { + if ([ + 'TRAVIS', + 'CIRCLECI', + 'APPVEYOR', + 'GITLAB_CI', + 'GITHUB_ACTIONS', + 'BUILDKITE', + 'DRONE' + ].some(sign => sign in env) || env.CI_NAME === 'codeship') { return COLORS_256; } return COLORS_2; From 46d4fad4fe39f04aef5acaacb09db5d2bf5ffd5c Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 10 Oct 2021 03:49:24 +1300 Subject: [PATCH 3/4] Update tty.js --- lib/internal/tty.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/tty.js b/lib/internal/tty.js index 0cdec90b9f4ad9..2aa73572708b2e 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -160,14 +160,14 @@ function getColorDepth(env = process.env) { if (env.CI) { if ([ - 'TRAVIS', - 'CIRCLECI', 'APPVEYOR', + 'BUILDKITE', + 'CIRCLECI', + 'DRONE', 'GITLAB_CI', 'GITHUB_ACTIONS', - 'BUILDKITE', - 'DRONE' - ].some(sign => sign in env) || env.CI_NAME === 'codeship') { + 'TRAVIS', + ].some((sign) => sign in env) || env.CI_NAME === 'codeship') { return COLORS_256; } return COLORS_2; From 53b3b5c5f650953eb80f86233a992010427d563d Mon Sep 17 00:00:00 2001 From: Richie Bendall Date: Sun, 10 Oct 2021 13:04:01 +1300 Subject: [PATCH 4/4] Update lib/internal/tty.js Co-authored-by: mscdex --- lib/internal/tty.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/tty.js b/lib/internal/tty.js index 2aa73572708b2e..5abf0b908b02cc 100644 --- a/lib/internal/tty.js +++ b/lib/internal/tty.js @@ -164,8 +164,8 @@ function getColorDepth(env = process.env) { 'BUILDKITE', 'CIRCLECI', 'DRONE', - 'GITLAB_CI', 'GITHUB_ACTIONS', + 'GITLAB_CI', 'TRAVIS', ].some((sign) => sign in env) || env.CI_NAME === 'codeship') { return COLORS_256;