-
Notifications
You must be signed in to change notification settings - Fork 296
safe-outputs: escalate handler failures to core.setFailed() #20055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
| .map(r => ` - ${r.type}: ${r.error || "Unknown error"}`) | ||
| .join("\n"); | ||
| core.setFailed(`${failureCount} safe output(s) failed:\n${failedItems}`); | ||
|
||
| } | ||
| if (cancelledCount > 0) { | ||
| core.warning(`${cancelledCount} message(s) were cancelled because a code push operation failed`); | ||
|
|
||
There was a problem hiding this comment.
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 thoughfailureCountis computed from the same predicate a few lines above. Consider computing a singlefailedResultsarray once and deriving bothfailureCountandfailedItemsfrom it to avoid future divergence and extra passes overprocessingResult.results.