diff --git a/CHANGELOG.md b/CHANGELOG.md index 624f1fe..bc5f6f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Add support for JSON comments in _variables_ and in JSON variable files and environment variables - Add support for multiple glob patterns separeted by a semi-colon (`;`) using [fast-glob](https://github.com/mrmlnc/fast-glob) in variable file paths - Add support for YAML variable files (`.yml` or `.yaml`) +- Fix log level (`info`) for groups ## v1.0.0 - Initial Release of the ReplaceTokens action \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index 5b9e558..c858f80 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47708,10 +47708,12 @@ async function run() { core.setFailed(args.join(' ')); // always set failure on error }; console.group = function (...args) { - core.startGroup(args.join(' ')); + if (logLevel < LogLevel.Warn) + core.startGroup(args.join(' ')); }; console.groupEnd = function () { - core.endGroup(); + if (logLevel < LogLevel.Warn) + core.endGroup(); }; // replace tokens const result = await (0, replacetokens_1.replaceTokens)(sources, variables, options); diff --git a/src/main.ts b/src/main.ts index 54509bb..df2b489 100644 --- a/src/main.ts +++ b/src/main.ts @@ -97,10 +97,10 @@ export async function run(): Promise { core.setFailed(args.join(' ')); // always set failure on error }; console.group = function (...args) { - core.startGroup(args.join(' ')); + if (logLevel < LogLevel.Warn) core.startGroup(args.join(' ')); }; console.groupEnd = function () { - core.endGroup(); + if (logLevel < LogLevel.Warn) core.endGroup(); }; // replace tokens diff --git a/tests/run.test.ts b/tests/run.test.ts index 1a78886..e03a3e8 100644 --- a/tests/run.test.ts +++ b/tests/run.test.ts @@ -614,8 +614,8 @@ describe('run', () => { expect(infoSpy).not.toHaveBeenCalledWith('info'); expect(warningSpy).toHaveBeenCalledWith('warn'); expect(setFailedSpy).toHaveBeenCalledWith('error'); - expect(startGroupSpy).toHaveBeenCalledWith('group'); - expect(endGroupSpy).toHaveBeenCalled(); + expect(startGroupSpy).not.toHaveBeenCalledWith('group'); + expect(endGroupSpy).not.toHaveBeenCalled(); }); it('log-level: error', async () => { @@ -651,8 +651,8 @@ describe('run', () => { expect(infoSpy).not.toHaveBeenCalledWith('info'); expect(warningSpy).not.toHaveBeenCalledWith('warn'); expect(setFailedSpy).toHaveBeenCalledWith('error'); - expect(startGroupSpy).toHaveBeenCalledWith('group'); - expect(endGroupSpy).toHaveBeenCalled(); + expect(startGroupSpy).not.toHaveBeenCalledWith('group'); + expect(endGroupSpy).not.toHaveBeenCalled(); }); it('missing-var-action', async () => {