Skip to content

Commit

Permalink
Add support for Gitea Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Jun 18, 2023
1 parent e06f284 commit 4234e8e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ function _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {
}

if ('CI' in env) {
if ('GITEA_ACTIONS' in env) {
return 1;
}

if ('GITHUB_ACTIONS' in env) {
return 3;
}
Expand Down
6 changes: 6 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,12 @@ test('return true if `DRONE` is in env', t => {
t.truthy(result.stdout);
});

test('return 1 if both `GITHUB_ACTIONS` and `GITEA_ACTIONS` are in env', t => {
process.env = {CI: true, GITHUB_ACTIONS: true, GITEA_ACTIONS: true};
const result = importFresh('./index.js');
t.is(result.stdout.level, 1);
});

test('return true if Codeship is in env', t => {
process.env = {CI: true, CI_NAME: 'codeship'};
const result = importFresh('./index.js');
Expand Down

0 comments on commit 4234e8e

Please sign in to comment.