Write a Github Action job summary
Write Markdown to the file in GITHUB_STEP_SUMMARY to add a table or a note to the job summary page. Each step gets its own file, and output is limited in size.
A job ends with numbers that deserve more than a line in the log, such as test counts or a list of files that changed.
export GITHUB_STEP_SUMMARY=$(mktemp)
{
echo "### Test results"
echo
echo "| Suite | Passed | Failed |"
echo "|---|---|---|"
echo "| unit | 120 | 0 |"
echo "| integration | 31 | 2 |"
} >> "$GITHUB_STEP_SUMMARY"
cat "$GITHUB_STEP_SUMMARY"### Test results
| Suite | Passed | Failed |
|---|---|---|
| unit | 120 | 0 |
| integration | 31 | 2 |The runner uploads the Markdown in GITHUB_STEP_SUMMARY when the step ends and shows it on the summary page of the run, as the job summaries documentation describes. Use >> so that one step can add to its own summary in several writes. The file printed here is a temporary stand-in for the one the runner creates, and the table is plain GitHub flavored Markdown.
Each step has its own file, and the summaries are shown together in step order. The size of one summary is limited to 1 MiB and the page may drop the rest, so write counts, not logs. The summary is public to anyone who can read the run, so keep secrets out of it.