From 7f809652e7658698ec150dff451bdd6028108b23 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Wed, 26 Jan 2022 19:22:48 -0500 Subject: [PATCH] feat(plugins/core): add `debug_print` option --- action.yml | 4 ++++ source/app/action/index.mjs | 8 ++++++++ source/plugins/core/metadata.yml | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/action.yml b/action.yml index 7e177210..b0da213d 100644 --- a/action.yml +++ b/action.yml @@ -195,6 +195,10 @@ inputs: description: Debug flags default: + debug_print: + description: Print output in console + default: + dryrun: description: Dry-run default: diff --git a/source/app/action/index.mjs b/source/app/action/index.mjs index a23ccf67..d2423bca 100644 --- a/source/app/action/index.mjs +++ b/source/app/action/index.mjs @@ -109,6 +109,7 @@ async function retry(func, {retries = 1, delay = 0} = {}) { "markdown.cache":_markdown_cache, debug, "debug.flags":dflags, + "debug.print":dprint, "use.mocked.data":mocked, dryrun, "plugins.errors.fatal":die, @@ -343,6 +344,13 @@ async function retry(func, {retries = 1, delay = 0} = {}) { throw new Error("Could not render metrics") info("Status", "complete") + //Debug print + if (dprint) { + info.break() + info.section("Debug print") + console.log(rendered) + } + //Output condition info.break() info.section("Saving") diff --git a/source/plugins/core/metadata.yml b/source/plugins/core/metadata.yml index 048739cf..0d3f91c2 100644 --- a/source/plugins/core/metadata.yml +++ b/source/plugins/core/metadata.yml @@ -420,6 +420,13 @@ inputs: testing: yes preset: no + debug_print: + description: Print output in console + type: boolean + default: no + testing: yes + preset: no + dryrun: description: | Dry-run