How to Write a Step Summary in GitHub Actions
Appending Markdown to GITHUB_STEP_SUMMARY renders a rich summary panel on the run page.
Write Markdown to the $GITHUB_STEP_SUMMARY file. GitHub displays it on the job summary, no artifact needed.
Steps
- Append Markdown lines to
$GITHUB_STEP_SUMMARY. - Use tables and headings for readable reports.
- Each step that appends adds to the same summary.
Workflow
.github/workflows/ci.yml
steps:
- run: |
{
echo "## Test results"
echo "| Suite | Status |"
echo "| --- | --- |"
echo "| unit | passed |"
echo "| e2e | passed |"
} >> "$GITHUB_STEP_SUMMARY"Gotchas
- The summary has a size cap (about 1 MiB); trim very large output.
- Overwrite the file with
>to reset; append with>>to add.
Related guides
How to Comment on a Pull Request From a Workflow in GitHub ActionsPost a comment on a pull request from a GitHub Actions workflow using actions/github-script and the GITHUB_TO…
How to Use continue-on-error in GitHub ActionsLet a GitHub Actions step or job fail without failing the run using continue-on-error, ideal for non-blocking…