How to Render a Job Summary Table in GitHub Actions
Anything appended to $GITHUB_STEP_SUMMARY is rendered as Markdown on the run summary page.
Append Markdown (including tables) to the $GITHUB_STEP_SUMMARY file. GitHub renders it at the top of the run, separate from the raw logs.
Steps
- Build the Markdown table in a step.
- Append it to
$GITHUB_STEP_SUMMARY. - View it on the run summary page once the job finishes.
Workflow
.github/workflows/ci.yml
steps:
- run: npm test
- name: Write summary
if: always()
run: |
{
echo "### Test results"
echo ""
echo "| Suite | Status |"
echo "| ----- | ------ |"
echo "| unit | ${{ job.status }} |"
echo "| lint | passed |"
} >> "$GITHUB_STEP_SUMMARY"Gotchas
- Each step appends to its own summary buffer; they are concatenated in order.
- The summary has a 1 MiB per-step cap, so truncate very large tables.
Related guides
How to Publish JUnit Results as a Check in GitHub ActionsTurn JUnit XML test output into a GitHub check with pass/fail counts and inline annotations using the dorny t…
How to Comment Build Results on a Pull Request in GitHub ActionsPost a single, self-updating build-results comment on a pull request from GitHub Actions with the marocchino…