From 40b3f97cde44167b2297827e63990698f478b807 Mon Sep 17 00:00:00 2001 From: lowlighter <22963968+lowlighter@users.noreply.github.com> Date: Mon, 26 Oct 2020 21:15:46 +0100 Subject: [PATCH] Add dry-run option --- action.yml | 6 ++++++ action/dist/index.js | 5 ++++- action/index.mjs | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index fd4ca92c..c30ca5fc 100644 --- a/action.yml +++ b/action.yml @@ -174,6 +174,12 @@ inputs: description: Enable debug logs default: no + # Enable dry-run mode + # Generate image but does not push it (used for testing) + dryrun: + description: Enable dry-run + default: no + # When enabled, any plugins errors will throw # By default, it will still generates metrics but renders an error message plugins_errors_fatal: diff --git a/action/dist/index.js b/action/dist/index.js index 66e8373f..f3b32049 100644 --- a/action/dist/index.js +++ b/action/dist/index.js @@ -911,7 +911,10 @@ var E_Users_lecoq_Documents_GitHub_gitstats_node_modules_actions_github_lib_gith console.log(`Render | complete`) //Commit to repository - { + const dryrun = core.getInput("dryrun") || false + if (dryrun) + console.log(`Dry-run | complete`) + else { //Committer token const token = core.getInput("committer_token") || core.getInput("token") console.log(`Committer token | ${token ? "provided" : "missing"}`) diff --git a/action/index.mjs b/action/index.mjs index 9299fdba..eea74ecf 100644 --- a/action/index.mjs +++ b/action/index.mjs @@ -117,7 +117,10 @@ console.log(`Render | complete`) //Commit to repository - { + const dryrun = core.getInput("dryrun") || false + if (dryrun) + console.log(`Dry-run | complete`) + else { //Committer token const token = core.getInput("committer_token") || core.getInput("token") console.log(`Committer token | ${token ? "provided" : "missing"}`)