feat: add ability to customize when job summary is displayed#93
Merged
Conversation
Add a new write-job-summary input with true, false, and on-failure-only modes to control when job summaries are written.\n\nUpdate runtime logic to validate and apply the mode across all summary paths, add tests for each mode and invalid values, and document usage in README/action metadata.\n\nBump package version to 2.5.7 and refresh generated coverage badge output.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a tri-state write-job-summary input (true / false / on-failure-only) to control when the action writes a GitHub job summary, addressing issue #92 where users wanted to suppress the summary in pipelines that already report their own results.
Changes:
- New
write-job-summaryinput wired into both summary-writing paths (no-actions path and normal results), gated by a new exportedshouldWriteJobSummary()helper with explicit validation of allowed values. - README and
action.ymlupdated to document the new input and add a usage example. - Tests cover all three modes plus invalid-input handling; version bumped to
2.5.7with lockfile and coverage badge updates.
Show a summary per file
| File | Description |
|---|---|
| src/index.js | Adds shouldWriteJobSummary helper, reads/validates write-job-summary input, gates both summary-writing branches, and reuses an allPassed local. |
| action.yml | Declares new write-job-summary input with default 'true'. |
| README.md | Documents new input in inputs table and adds an on-failure-only usage example. |
| tests/index.test.js | Adds default write-job-summary mock and tests for false, on-failure-only (pass + fail), and invalid input. |
| package.json | Bumps version to 2.5.7. |
| package-lock.json | Syncs lockfile to 2.5.7. |
| badges/coverage.svg | Updates coverage badge to 90.94%. |
Copilot's findings
- Files reviewed: 5/7 changed files
- Comments generated: 0
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📦 Draft Release CreatedA draft release v2.6.0 has been created for this PR. Next Steps
|
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.
Why
Issue #92 highlighted that summary output can be noisy in some pipelines, and teams need control over when a job summary is written.
What changed
write-job-summaryinput inaction.ymlwith three supported values:true(default): always write the job summaryfalse: never write the job summaryon-failure-only: write only when mutable or unsupported references are foundsrc/index.jsto:write-job-summaryvalues__tests__/index.test.jsto cover:falsemodeon-failure-onlymode for both passing and failing results2.5.7and updated lockfile/badge artifactsNotes for reviewers