Skip to content

Commit 7cec1df

Browse files
committed
chore(repo): Correctly format release slack notification
1 parent 4b9a5af commit 7cec1df

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.github/workflows/release-prod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
"type": "section",
7070
"text": {
7171
"type": "mrkdwn",
72-
"text": "${{ steps.notification.outputs.message }}"
72+
"text": ${{ steps.notification.outputs.message }}
7373
}
7474
}
7575
]

scripts/notify.mjs

+11-4
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,22 @@ const packages = releasedPackages.map(({ name, version }) => {
4141
return { name, version, url };
4242
});
4343

44+
// Slack is using their own Markdown format, see:
45+
// https://api.slack.com/reference/surfaces/formatting#basics
46+
// https://app.slack.com/block-kit-builder
4447
let message = '';
45-
message += `Javascript SDKs - Stable Release - ${new Date().toLocaleDateString('en-US')}\n\n`;
48+
message += `*Javascript SDKs - Stable Release - ${new Date().toLocaleDateString('en-US')}*\n\n`;
4649
for (const { name, version, url } of packages) {
47-
message += `- \`${name}@${version}\` ([release notes ↗](<${url}>))\n`;
50+
message += ` \`${name}@${version}\` - <${url}|release notes>\n`;
4851
}
4952

5053
// TODO: Get PR number using the GitHub API
5154
// if (prNumber) {
52-
// message += `\nView the [release PR ↗](<https://github.com/clerkinc/javascript/pull/${prNumber}>)`;
55+
// message += `\nView <https://github.com/clerkinc/javascript/pull/${prNumber}|release PR>`;
5356
// }
5457

55-
console.log(message);
58+
message += `\nView <https://github.com/clerkinc/javascript/pulls?q=is%3Apr+is%3Aclosed+Version+Packages+in%3Atitle+merged%3A${new Date()
59+
.toISOString()
60+
.slice(0, 10)}|all release PRs for this day>`;
61+
62+
console.log(JSON.stringify(message));

0 commit comments

Comments
 (0)