GitHub Actions / Reusable automation and scoped authority / Lesson 14
Job summaries and trustworthy evidence
Report workflow results with clear counts and revision context while protecting sensitive data.
On this page
Lesson goals
- Distinguish a job summary from the underlying test evidence.
- Design summary fields that reveal skipped or empty test selections.
Use summaries as a navigation aid
A job summary can present concise Markdown alongside a workflow run, but it is a report produced by workflow code rather than an independent verification system. Link each claim to the relevant job, source revision and retained test artifact. GitHub documents a step-specific summary environment file; behavior and limits should be checked for the deployed GitHub product and action versions.
Inspect a synthetic result
The first JSON fixture represents twelve selected and passed tests for revision abc123. It is an illustrative report, not an actual run or a complete provenance record. A useful summary would state the command, candidate identity, selected tests and result, then link to the underlying report. Protect credentials and sensitive payloads; automatic masking is not a license to print secrets.
{"revision":"abc123","tests_selected":12,"tests_passed":12,"tests_failed":0}
The numbers are declared fixture values and no workflow was run.
Expose an empty selection
The second fixture also has zero failures, but no tests were selected. A summary that reports only the failure count could make this look like an equivalent success. Treat empty selection according to the project’s explicit policy and show selected, executed, passed, failed and skipped counts when available. Verify that those numbers come from the intended current run and test report.
{"revision":"abc123","tests_selected":0,"tests_passed":0,"tests_failed":0}
Zero failures with zero selected tests does not establish that any test passed.
Keep untrusted data and secrets bounded
Pull request text, file names and generated reports may contain untrusted content. Render or escape them according to the receiving context and avoid interpolating them into shell commands. Summaries and artifacts can be visible to people with repository access, so include only approved sanitized values. A summary should not include token values, connection strings or sensitive customer records.
Test reporting and the actual gate
In a disposable repository, run a synthetic passing test, a controlled failure and an empty selection. Compare the summary with the underlying report and check the required job status for each case. Confirm that reporting after failure does not turn the release gate green unintentionally. Record the action version and run identity; do not publish real production data for the exercise.
Common errors and fixes
Zero failed tests is presented as proof of a successful suite.
- Why it happens
- No tests were selected.
- How to fix it
- Report and enforce the expected selection count.
- Prevent it next time
- Test an empty selection in CI.
A summary describes a different revision.
- Why it happens
- The report and candidate identities were not connected.
- How to fix it
- Compare the run, checkout and artifact identity.
- Prevent it next time
- Include revision and run context with evidence.
A summary exposes a secret.
- Why it happens
- Workflow output was treated as private.
- How to fix it
- Remove exposed material and follow credential response procedures.
- Prevent it next time
- Use sanitized approved fields only.
2 practice exercises
1. Does the second fixture show a successful test suite?
Show worked solution
No. It shows no failures but also no selected tests. Inspect the selection and the project’s empty-selection policy before accepting the result.
2. What should accompany a claim that revision abc123 passed twelve tests?
Show worked solution
The actual run and checkout identity, command or selection, underlying test report and the status of the required gate. The synthetic fixture alone is not evidence of a real execution.
Key takeaways
- A summary is a report whose claims need underlying run evidence.
- Show selection and result counts without exposing sensitive data.