Skip to content

Commit

Permalink
Trim annotation message if too long (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
int128 committed Aug 21, 2024
1 parent 7c202da commit 56a0497
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,13 @@ export const getFailedJobCause = (failedJob: FailedJob, templates: Templates): s
}

if (failedJob.failureAnnotationMessages.length > 0) {
return ['```', ...failedJob.failureAnnotationMessages, '```']
const failureAnnotationMessages = failedJob.failureAnnotationMessages.map((message) => {
if (message.length > 300) {
return message.substring(0, 300) + '...'
}
return message
})
return ['```', ...failureAnnotationMessages, '```']
}
return []
}
Expand Down

0 comments on commit 56a0497

Please sign in to comment.