Skip to content

Commit bf9f184

Browse files
committed
style: format gallery notification messages
1 parent bee3511 commit bf9f184

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎scripts/notify-gallery-links.mjs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,16 @@ function makePayload({ transition, failures, previous, workflowUrl }) {
113113
const omitted = failures.length - names.length;
114114
let content;
115115
if (transition === "recovery") {
116-
content = `Gallery link checks recovered. Previous failures: ${previous.permissionCount} permission, ${previous.invalidCount} invalid.`;
116+
content = `Gallery link checks recovered.\n\nPrevious failures: ${previous.permissionCount} permission, ${previous.invalidCount} invalid.`;
117117
} else {
118118
content = `${transition === "initial" ? "Gallery link checks failing" : "Gallery link failures changed"}: ${failures.length} affected.`;
119-
if (names.length)
120-
content += ` Affected galleries: ${names.join(", ")}${omitted ? ` (and ${omitted} more)` : ""}.`;
119+
if (names.length) {
120+
const affected = names.map((name) => `- ${name}`).join("\n");
121+
content += `\n\nAffected galleries:\n${affected}`;
122+
if (omitted) content += `\n- ...and ${omitted} more`;
123+
}
121124
}
122-
content += ` Workflow: ${String(workflowUrl).slice(0, 500)}`;
125+
content += `\n\nWorkflow: ${String(workflowUrl).slice(0, 500)}`;
123126
return {
124127
content:
125128
content.length <= MAX_CONTENT

0 commit comments

Comments
 (0)