Skip to content
Latchkey

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

Run this faster and cheaper on Latchkey managed runners. Start free →