Skip to content

Commit b2d5835

Browse files
authored
[CI] Reduce CLI log output in CI jobs (#2934)
## Motivation for the change, related issues Prevents printing all the progress updates in CI / dumb terminal to avoid generating 20MB of `downloading WordPress: 17.46%` lines.
1 parent 702e9b0 commit b2d5835

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
export function shouldRenderProgress(
22
writeStream?: { isTTY?: boolean } | null
33
): boolean {
4-
const termIsDumb = (process.env['TERM'] || '').toLowerCase() === 'dumb';
5-
const ciFlag = (process.env['CI'] || '').toLowerCase();
6-
const runningInCI = ciFlag === '1' || ciFlag === 'true';
7-
8-
if (termIsDumb || runningInCI) {
4+
if (process.env['CI'] === 'true' || process.env['CI'] === '1') {
5+
return false;
6+
}
7+
if (
8+
process.env['GITHUB_ACTIONS'] === 'true' ||
9+
process.env['GITHUB_ACTIONS'] === '1'
10+
) {
11+
return false;
12+
}
13+
if ((process.env['TERM'] || '').toLowerCase() === 'dumb') {
914
return false;
1015
}
11-
1216
if (writeStream) {
1317
return Boolean(writeStream.isTTY);
1418
}
15-
16-
return true;
19+
return process.stdout.isTTY;
1720
}

0 commit comments

Comments
 (0)