From 038b21a8898d70d57e63c0220d2c063982fa6dc0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Wed, 28 Jun 2023 15:49:41 +0200 Subject: [PATCH] Add support for Gitea Actions (#148) --- index.js | 2 +- test.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index ca95e9f..4ce0a2d 100644 --- a/index.js +++ b/index.js @@ -112,7 +112,7 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) { } if ('CI' in env) { - if ('GITHUB_ACTIONS' in env) { + if ('GITHUB_ACTIONS' in env || 'GITEA_ACTIONS' in env) { return 3; } diff --git a/test.js b/test.js index 8866073..dfcb2f1 100644 --- a/test.js +++ b/test.js @@ -215,6 +215,12 @@ test('return true if `DRONE` is in env', t => { t.truthy(result.stdout); }); +test('return level 3 if `GITEA_ACTIONS` is in env', t => { + process.env = {CI: true, GITEA_ACTIONS: true}; + const result = importFresh('./index.js'); + t.is(result.stdout.level, 3); +}); + test('return true if Codeship is in env', t => { process.env = {CI: true, CI_NAME: 'codeship'}; const result = importFresh('./index.js');