Skip to content

Commit a7643fa

Browse files
authored
Add summary parameter to action (#3958)
1 parent d291c23 commit a7643fa

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343

4444
### Integrations
4545

46-
<!-- For example, Docker, GitHub Actions, pre-commit, editors -->
46+
- The summary output for GitHub workflows is now suppressible using the `summary`
47+
parameter. (#3958)
4748

4849
### Documentation
4950

action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ inputs:
2727
description: 'Python Version specifier (PEP440) - e.g. "21.5b1"'
2828
required: false
2929
default: ""
30+
summary:
31+
description: "Whether to add the output to the workflow summary"
32+
required: false
33+
default: true
3034
branding:
3135
color: "black"
3236
icon: "check-circle"
@@ -47,10 +51,12 @@ runs:
4751
# Display the raw output in the step
4852
echo "${out}"
4953
50-
# Display the Markdown output in the job summary
51-
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
52-
echo "${out}" >> $GITHUB_STEP_SUMMARY
53-
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
54+
if [ "${{ inputs.summary }}" == "true" ]; then
55+
# Display the Markdown output in the job summary
56+
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
57+
echo "${out}" >> $GITHUB_STEP_SUMMARY
58+
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
59+
fi
5460
5561
# Exit with the exit-code returned by Black
5662
exit ${exit_code}

0 commit comments

Comments
 (0)