From a7643fac8d97c15640a2b1a79f68b3dc771aebfb Mon Sep 17 00:00:00 2001 From: Dario Curreri <48800335+dariocurr@users.noreply.github.com> Date: Mon, 23 Oct 2023 18:40:09 +0200 Subject: [PATCH] Add summary parameter to action (#3958) --- CHANGES.md | 3 ++- action.yml | 14 ++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index fe0b2ebb9d8..89837c8f545 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -43,7 +43,8 @@ ### Integrations - +- The summary output for GitHub workflows is now suppressible using the `summary` + parameter. (#3958) ### Documentation diff --git a/action.yml b/action.yml index 8b698ae3c80..a22005ac243 100644 --- a/action.yml +++ b/action.yml @@ -27,6 +27,10 @@ inputs: description: 'Python Version specifier (PEP440) - e.g. "21.5b1"' required: false default: "" + summary: + description: "Whether to add the output to the workflow summary" + required: false + default: true branding: color: "black" icon: "check-circle" @@ -47,10 +51,12 @@ runs: # Display the raw output in the step echo "${out}" - # Display the Markdown output in the job summary - echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY - echo "${out}" >> $GITHUB_STEP_SUMMARY - echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + if [ "${{ inputs.summary }}" == "true" ]; then + # Display the Markdown output in the job summary + echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY + echo "${out}" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + fi # Exit with the exit-code returned by Black exit ${exit_code}