mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-06-28 10:45:08 +00:00
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:
parent
b9c8c4c7ba
commit
c2514a526e
1 changed files with 21 additions and 0 deletions
21
src/utils/logging.ts
Normal file
21
src/utils/logging.ts
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue