Skip to content

Commit

Permalink
refactor(ci): improve summary report formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Juarez Rudsatz authored and juarezr committed Sep 23, 2024
1 parent 2fc148c commit 8af57d4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/actions/workflow-info/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runs:
local text;
if ! text="$(cat -)"; then printf 'Failed to dump context for %s\n' "${1:-Unknown}" >> "${GITHUB_STEP_SUMMARY}"; fi
text="${text#"${text%%[![:space:]]*}"}"
if test -n "${text:-}"; then
if test "${#text}" -gt 3; then
printf '\n### %s Context\n\n\n```json\n%s\n```\n' "${1:-Unknown}" "${text:-Nothing in context}" >> "${GITHUB_STEP_SUMMARY}";
fi
echo "::endgroup::";
Expand All @@ -52,7 +52,10 @@ runs:
echo '- github.sha: ${{ github.sha }}' >> "${GITHUB_STEP_SUMMARY}";
echo "${REPORT_PARAMS:-}" | dump_ctx "Parameters";
echo "${REPORT_CONTENT:-}" | dump_ctx "Job";
if test -n "${REPORT_CONTENT:-}"; then
printf '\n## Summary\n\n' >> "${GITHUB_STEP_SUMMARY}";
echo "${REPORT_CONTENT:-}" >> "${GITHUB_STEP_SUMMARY}";
fi
printf '\n## Context Information\n' >> "${GITHUB_STEP_SUMMARY}";
echo '${{ toJson(runner) }}' | dump_ctx "Runner";
Expand Down

0 comments on commit 8af57d4

Please sign in to comment.