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;