Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions actions/setup/js/safe_output_handler_manager.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,11 @@ async function main() {

if (failureCount > 0) {
core.warning(`${failureCount} message(s) failed to process`);
const failedItems = processingResult.results
.filter(r => !r.success && !r.deferred && !r.skipped && !r.cancelled)
Comment on lines +929 to +930
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The failure filter logic (!r.success && !r.deferred && !r.skipped && !r.cancelled) is duplicated here even though failureCount is computed from the same predicate a few lines above. Consider computing a single failedResults array once and deriving both failureCount and failedItems from it to avoid future divergence and extra passes over processingResult.results.

Suggested change
const failedItems = processingResult.results
.filter(r => !r.success && !r.deferred && !r.skipped && !r.cancelled)
const failedItems = failedResults

Copilot uses AI. Check for mistakes.
.map(r => ` - ${r.type}: ${r.error || "Unknown error"}`)
.join("\n");
core.setFailed(`${failureCount} safe output(s) failed:\n${failedItems}`);
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

This new core.setFailed(...) path is not currently covered by unit tests: safe_output_handler_manager.test.cjs exercises processMessages, but not main()'s summary/failure aggregation. Add a test that simulates one or more non-deferred/non-skipped/non-cancelled failures and asserts core.setFailed is called (and not called for purely deferred/cancelled/skipped results) so the step-exit behavior can’t regress back to exit-0.

Copilot uses AI. Check for mistakes.
}
if (cancelledCount > 0) {
core.warning(`${cancelledCount} message(s) were cancelled because a code push operation failed`);
Expand Down
Loading