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
Closed
Fix issue where details tag & quick summary was always added even when there is only a single project#43sindrisig wants to merge 1 commit intoweb-infra-dev:mainfrom
sindrisig wants to merge 1 commit intoweb-infra-dev:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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/coretests for othersrc/index.tsexports, 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 on lines
488
to
489
| if (reportsWithCurrent.length > 1) { | ||
| // Check if any project has changes (any non-zero change) |
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.
Based on the comment found on line 547
This PR fixes the issue where quick summary and detailed tag are rendered for a single project report.