Skip to content

Fix issue where details tag & quick summary was always added even when there is only a single project#43

Closed
sindrisig wants to merge 1 commit intoweb-infra-dev:mainfrom
sindrisig:main
Closed

Fix issue where details tag & quick summary was always added even when there is only a single project#43
sindrisig wants to merge 1 commit intoweb-infra-dev:mainfrom
sindrisig:main

Conversation

@sindrisig
Copy link
Copy Markdown
Contributor

Based on the comment found on line 547

Only add collapse wrapper if there are multiple reports with changes

This PR fixes the issue where quick summary and detailed tag are rendered for a single project report.

Copilot AI review requested due to automatic review settings April 16, 2026 10:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes PR comment formatting so the “Quick Summary” and “Detailed Reports” collapsible sections aren’t added when there’s only a single project report, aligning behavior with the existing inline comment (“Only add collapse wrapper if there are multiple reports with changes”).

Changes:

  • Only render the “📊 Quick Summary” collapsible section when there are multiple project reports.
  • Only wrap “📋 Detailed Reports” in a <details> block when multiple projects have changes.
  • Updates the compiled action entrypoint (dist/index.js) to match the TypeScript logic.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/index.ts Adjusts PR comment generation logic to avoid collapsible wrappers for single-project cases.
dist/index.js Rebuild output reflecting the updated PR comment generation logic used by the action runtime.
Comments suppressed due to low confidence (1)

src/index.ts:492

  • This change alters PR-comment rendering behavior but there are no tests covering the single-project PR comment output (e.g., ensuring no <details> wrappers are emitted and that the comment still contains useful content when there are zero changes). Since this repo already has @rstest/core tests for other src/index.ts exports, adding a focused test for this scenario would help prevent regressions.
      if (reportsWithCurrent.length > 1) {
        // Check if any project has changes (any non-zero change)
        let hasChanges = false;
        for (const report of reportsWithCurrent) {
          if (!report.current) continue;

Comment thread src/index.ts Outdated
Comment on lines 488 to 489
if (reportsWithCurrent.length > 1) {
// Check if any project has changes (any non-zero change)
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.

2 participants