Skip to content

feat: add ability to customize when job summary is displayed#93

Merged
joshjohanning merged 2 commits into
mainfrom
joshjohanning/hide-summary-table-option
May 29, 2026
Merged

feat: add ability to customize when job summary is displayed#93
joshjohanning merged 2 commits into
mainfrom
joshjohanning/hide-summary-table-option

Conversation

@joshjohanning

Copy link
Copy Markdown
Owner

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

  • Added a new write-job-summary input in action.yml with three supported values:
    • true (default): always write the job summary
    • false: never write the job summary
    • on-failure-only: write only when mutable or unsupported references are found
  • Updated runtime handling in src/index.js to:
    • Validate allowed write-job-summary values
    • Apply summary gating in both summary paths (normal results and no-actions path)
  • Expanded tests in __tests__/index.test.js to cover:
    • false mode
    • on-failure-only mode for both passing and failing results
    • Invalid input handling
  • Updated README inputs/examples for the new tri-state behavior
  • Bumped package version to 2.5.7 and updated lockfile/badge artifacts

Notes for reviewers

  • This PR intentionally scopes only the summary-write configurability.
  • The separate "Failed" header wording/semantics follow-up is planned independently to keep review and merge conflict risk lower.

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>
Copilot AI review requested due to automatic review settings May 29, 2026 20:37
@joshjohanning joshjohanning changed the title Add tri-state write-job-summary input feat: add ability to customize when job summary is displayed May 29, 2026
@joshjohanning joshjohanning linked an issue May 29, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-summary input wired into both summary-writing paths (no-actions path and normal results), gated by a new exported shouldWriteJobSummary() helper with explicit validation of allowed values.
  • README and action.yml updated to document the new input and add a usage example.
  • Tests cover all three modes plus invalid-input handling; version bumped to 2.5.7 with 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>
@joshjohanning joshjohanning merged commit 1bce477 into main May 29, 2026
4 checks passed
@joshjohanning joshjohanning deleted the joshjohanning/hide-summary-table-option branch May 29, 2026 20:47
@github-actions

Copy link
Copy Markdown

📦 Draft Release Created

A draft release v2.6.0 has been created for this PR.

🔗 View Draft Release

Next Steps

  • Review the release notes
  • Publish the release to make it permanent

This is an automated reminder from the publish-github-action workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add option to hide summary table?

2 participants