From 1030d230b75d73d1f2417619618a6803ec1e6740 Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Sun, 11 Oct 2026 07:58:22 +1100 Subject: [PATCH 1/3] fix: use consistent GitHub Actions environment detection --- src/logtask/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logtask/index.ts b/src/logtask/index.ts index 79f54ad6..4d0882bc 100644 --- a/src/logtask/index.ts +++ b/src/logtask/index.ts @@ -264,7 +264,7 @@ export default class LogTask { const desc = message === '' ? `Completed ${this.name}.` : message; if (ingroup) { this.ingroup = false; - if (process.env.GITHUB_ACTIONS) { + if (isGithubActions()) { core.endGroup(); } } @@ -281,11 +281,11 @@ export default class LogTask { const desc = message === '' ? `Failed ${this.name}.` : message; if (ingroup) { this.ingroup = false; - if (process.env.GITHUB_ACTIONS) { + if (isGithubActions()) { core.endGroup(); } } - const msgtype = process.env.GITHUB_ACTIONS ? LogGroup.IS_FAILED : LogGroup.IS_ERROR; + const msgtype = isGithubActions() ? LogGroup.IS_FAILED : LogGroup.IS_ERROR; this.logStep('❌', 'FAILURE', desc, msgtype); } From 0bf72354280e64a8cc9ff8b77d2c493ef42eea58 Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Sun, 11 Oct 2026 08:05:01 +1100 Subject: [PATCH 2/3] fix: call existing inGitHubActions predicate --- src/logtask/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/logtask/index.ts b/src/logtask/index.ts index 4d0882bc..8a8dbbc8 100644 --- a/src/logtask/index.ts +++ b/src/logtask/index.ts @@ -264,7 +264,7 @@ export default class LogTask { const desc = message === '' ? `Completed ${this.name}.` : message; if (ingroup) { this.ingroup = false; - if (isGithubActions()) { + if (inGitHubActions()) { core.endGroup(); } } @@ -281,11 +281,11 @@ export default class LogTask { const desc = message === '' ? `Failed ${this.name}.` : message; if (ingroup) { this.ingroup = false; - if (isGithubActions()) { + if (inGitHubActions()) { core.endGroup(); } } - const msgtype = isGithubActions() ? LogGroup.IS_FAILED : LogGroup.IS_ERROR; + const msgtype = inGitHubActions() ? LogGroup.IS_FAILED : LogGroup.IS_ERROR; this.logStep('❌', 'FAILURE', desc, msgtype); } From ffb74455a2d0db63ce71b96dadcf50cbd5501dc7 Mon Sep 17 00:00:00 2001 From: Jamie Nelson Date: Sun, 11 Oct 2026 09:43:03 +1100 Subject: [PATCH 3/3] test: expect local failures to use core.error rather than setFailed --- __tests__/logtask/index.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/__tests__/logtask/index.test.ts b/__tests__/logtask/index.test.ts index 693186ba..3f9c1802 100644 --- a/__tests__/logtask/index.test.ts +++ b/__tests__/logtask/index.test.ts @@ -140,7 +140,7 @@ describe('LogTask', () => { it('should log a failure message', () => { vi.stubEnv('GITHUB_ACTIONS', 'false'); logTask.fail(testMessage); - expect(core.setFailed).toHaveBeenCalledWith( + expect(core.error).toHaveBeenCalledWith( chalk.bgRedBright(`[FAILURE][TestTask ] ❌: ${chalk.yellow.bold(testMessage)}`), ); }); @@ -148,7 +148,7 @@ describe('LogTask', () => { it('should log a failure message without ingroup', () => { vi.stubEnv('GITHUB_ACTIONS', 'false'); logTask.fail(testMessage, false); - expect(core.setFailed).toHaveBeenCalledWith( + expect(core.error).toHaveBeenCalledWith( chalk.bgRedBright(`[FAILURE][TestTask ] ❌: ${chalk.yellow.bold(testMessage)}`), ); }); @@ -158,6 +158,7 @@ describe('LogTask', () => { logTask.ingroup = true; logTask.fail(testMessage); expect(core.endGroup).toHaveBeenCalled(); + expect(core.setFailed).toHaveBeenCalled(); }); });