feat: add GitHub Actions step summary for workflow runs#342
Merged
Conversation
### What
Write run statistics as markdown to $GITHUB_STEP_SUMMARY so results
appear on the workflow run summary page in the GitHub UI. The summary
includes overall stats, repositories with users to remove, and
repositories missing CODEOWNERS files. It runs unconditionally when
the environment variable is present and silently no-ops otherwise.
On error, the summary still writes with partial stats and an error
section, then exits with code 1.
### Why
Previously the only way to see run results was to dig into the job
logs. Surfacing the report on the summary page gives immediate
visibility without expanding log output.
### Notes
- The summary file is opened in append mode ("a") per GitHub's
convention, so other steps can also contribute to the summary
- Unlike the existing write_to_markdown (gated by ISSUE_REPORT),
write_step_summary always runs — no configuration needed
- The main loop is wrapped in try/except/finally so the summary
always writes, even on failure. Partial stats are preserved and
the error message is surfaced in a dedicated section
- Success example with PR link(s): https://gist.github.com/jmeridth/0fbb8bb34882e437afdde0b81944b80f
- Success example with no changes needed: https://gist.github.com/jmeridth/deef8adb4dca29dd9e7ebe25e0db73fa
- Error example: https://gist.github.com/jmeridth/6918e8dbcada95683da31d653c6b0e8b
Signed-off-by: jmeridth <jmeridth@gmail.com>
Collaborator
Author
|
@zkoppert i woke up realizing we may want some emojis in the summary. 🤔 |
zkoppert
reviewed
Mar 1, 2026
| codeowners_count, | ||
| repo_and_users_to_remove, | ||
| repos_missing_codeowners, | ||
| write_step_summary( |
Collaborator
There was a problem hiding this comment.
Should writing the step summary be able to be disabled if someone doesn't want it? Maybe we just wait to see what users say?
Collaborator
Author
There was a problem hiding this comment.
Agree, lets see what users say
### What Add a section to the README describing the automatic step summary that appears on the workflow run summary page. ### Why Users should know this feature exists without reading the source code. The summary requires no configuration but its existence isn't discoverable from the current documentation. ### Notes - Placed before "Example workflows" since it describes built-in behavior rather than a configuration option Signed-off-by: Jason Meridth <jmeridth@gmail.com> Signed-off-by: jmeridth <jmeridth@gmail.com>
… var ### What Add an ENABLE_GITHUB_ACTIONS_STEP_SUMMARY boolean environment variable that controls whether the workflow run summary is written. The default is true, so the step summary is enabled out of the box. ### Why Making the feature controllable via an environment variable is consistent with how other optional behaviors (DRY_RUN, ISSUE_REPORT) are configured in this action. Defaulting to true ensures users get the summary without extra configuration while still allowing opt-out. ### Notes - Existing users will see summaries immediately after upgrading since the default is true; set to false to opt out - The boolean check happens before the GITHUB_STEP_SUMMARY file path check, so the function returns early without touching the filesystem when disabled - Table column widths in the README were adjusted to accommodate the longer env var name and pass markdownlint MD060 Signed-off-by: Jason Meridth <jmeridth@gmail.com> Signed-off-by: jmeridth <jmeridth@gmail.com>
## What Extract duplicated repos/users-to-remove and repos-missing-codeowners sections from write_to_markdown and write_step_summary into shared helper functions _write_repos_and_users_to_remove and _write_repos_missing_codeowners. ## Why Prevents the two output functions from diverging over time as changes are made to the shared sections independently. ## Notes - Stats sections intentionally remain separate since their formatting differs significantly between the report file and step summary. - Helpers are prefixed with underscore to indicate internal use. Signed-off-by: Jason Meridth <jmeridth@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: jmeridth <jmeridth@gmail.com>
## What Print "GITHUB_STEP_SUMMARY not set, skipping step summary" instead of silently returning when the runner environment variable is absent. ## Why When a user enables the step summary feature but runs outside GitHub Actions, this message explains why no summary was written. ## Notes - Addresses PR review feedback from @zkoppert on #342. Signed-off-by: Jason Meridth <jmeridth@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: jmeridth <jmeridth@gmail.com>
Signed-off-by: jmeridth <jmeridth@gmail.com>
## What Add contextual emojis to step summary section headers to provide visual status indicators at a glance. ## Why Makes the GitHub Actions step summary easier to scan by surfacing the overall health of the run through visual cues in the section titles. ## Notes - ✅ on Overall Stats when no users to remove AND no missing CODEOWNERS files;⚠️ otherwise. -⚠️ on Repositories and Users to Remove / Missing CODEOWNERS only when there is no error (avoids double signaling with ❌). - 🔗 always on Pull Requests Created. - ❌ always on Error. - Emojis only affect step summary output, not the report.md file used for issue creation. - Helper functions accept an optional header_suffix so write_to_markdown continues to produce emoji-free output. Signed-off-by: Jason Meridth <jmeridth@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: jmeridth <jmeridth@gmail.com>
Signed-off-by: jmeridth <jmeridth@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Proposed Changes
What
Write run statistics as markdown to $GITHUB_STEP_SUMMARY so results appear on the workflow run summary page in the GitHub UI. The summary includes overall stats, repositories with users to remove, repositories missing CODEOWNERS files, and pull request links for any pull requests generated. It runs unconditionally when the environment variable is present and silently no-ops otherwise. On error, the summary still writes with partial stats and an error section, then exits with code 1.
Why
Previously the only way to see run results was to dig into the job logs. Surfacing the report on the summary page gives immediate visibility without expanding log output.
Notes
Readiness Checklist
Author/Contributor
make lintand fix any issues that you have introducedmake testand ensure you have test coverage for the lines you are introducing