From c2514a526e9ff530e5c12fa098a076a7b6ed5a46 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sun, 31 May 2026 12:37:01 +0200 Subject: [PATCH] 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 --- src/utils/logging.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/utils/logging.ts diff --git a/src/utils/logging.ts b/src/utils/logging.ts new file mode 100644 index 0000000..49dc860 --- /dev/null +++ b/src/utils/logging.ts @@ -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;