Add quiet input to suppress info-level log output

When quiet: true, only warnings and errors are logged.
All info calls are routed through a new logging module that
reads the quiet input via core.getInput on first use.

- Add src/utils/logging.ts with lazy-initialized quiet flag
- Add quiet boolean input to action.yml and action-types.yml
- Add quiet to SetupInputs interface and loadInputs()
- Replace core.info/core.warning with log.info/log.warning
  across all source files
- Keep ##[add-matcher] workflow command on core.info directly
  to avoid suppressing it in quiet mode
- Update README with new input
This commit is contained in:
Kevin Stillhammer 2026-05-31 12:37:01 +02:00
parent b9c8c4c7ba
commit c2514a526e
No known key found for this signature in database

21
src/utils/logging.ts Normal file
View file

@ -0,0 +1,21 @@
import * as core from "@actions/core";
let quiet: boolean | undefined;
function isQuiet(): boolean {
if (quiet === undefined) {
quiet =
typeof core.getInput === "function" && core.getInput("quiet") === "true";
}
return quiet;
}
export function info(msg: string): void {
if (!isQuiet()) {
core.info(msg);
}
}
export const warning = core.warning;
export const error = core.error;
export const debug = core.debug;