Skip to content

Commit

Permalink
Add summary parameter to action (#3958)
Browse files Browse the repository at this point in the history
  • Loading branch information
dariocurr committed Oct 23, 2023
1 parent d291c23 commit a7643fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Expand Up @@ -43,7 +43,8 @@

### Integrations

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

### Documentation

Expand Down
14 changes: 10 additions & 4 deletions action.yml
Expand Up @@ -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"
Expand All @@ -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}
Expand Down

0 comments on commit a7643fa

Please sign in to comment.