Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 8fe1bae

Browse files
authored
Update feature-launcher.yml (#1138)
1 parent 44f065a commit 8fe1bae

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed
Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Automate Engineering Feature Release Campaigns
2-
32
on:
43
issues:
54
types: [labeled]
6-
75
jobs:
86
notify-discord:
97
if: github.event.label.name == 'feature-release'
@@ -12,48 +10,50 @@ jobs:
1210
- name: Send Feature Release Notification to Discord
1311
env:
1412
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
15-
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
13+
SLACK_COMMUNITY_RELEASE_WEBHOOK: ${{ secrets.SLACK_COMMUNITY_RELEASE_WEBHOOK }}
14+
SLACK_COMMUNITY_ENGAGEMENT_WEBHOOK: ${{ secrets.SLACK_COMMUNITY_ENGAGEMENT_WEBHOOK }}
1615
ISSUE_TITLE: ${{ github.event.issue.title }}
1716
ISSUE_BODY: ${{ github.event.issue.body }}
1817
ISSUE_URL: ${{ github.event.issue.html_url }}
1918
run: |
20-
node -e '
21-
const https = require("https");
19+
node -e "
20+
const https = require('https');
2221
const discordWebhook = new URL(process.env.DISCORD_WEBHOOK);
23-
const slackWebhook = new URL(process.env.SLACK_WEBHOOK);
24-
22+
const slackCommunityReleaseWebhook = new URL(process.env.SLACK_COMMUNITY_RELEASE_WEBHOOK);
23+
const slackCommunityEngagementWebhook = new URL(process.env.SLACK_COMMUNITY_ENGAGEMENT_WEBHOOK);
2524
const issueTitle = process.env.ISSUE_TITLE;
2625
const issueBody = process.env.ISSUE_BODY;
2726
const issueUrl = process.env.ISSUE_URL;
2827
29-
// Discord Payload
3028
const discordPayload = {
3129
content: [
32-
"**🚀 " +issueTitle + " has been released!**",
33-
"",
34-
"**🌟 Whats new in CodeGate:**",
30+
'**🚀 ' + issueTitle + ' has been released!**',
31+
'',
32+
'**🌟 Whats new in CodeGate:**',
3533
issueBody,
36-
"",
37-
"We would 🤍 your feedback! 🔗 [Heres the GitHub issue](" + issueUrl + ")"
38-
].join("\n")
34+
'',
35+
'We would 🤍 your feedback! 🔗 [Here\'s the GitHub issue](' + issueUrl + ')'
36+
].join('\n')
3937
};
4038
41-
// Slack Payload
42-
const slackPayload = {
43-
text: `🚀 *${issueTitle}* has been released!\n\n 🔗 <${issueUrl}|Here’s the GitHub issue>`,
39+
const slackCommunityReleasePayload = {
40+
text: '🚀 ' + issueTitle + ' has been released!\\n\\n 🔗 <' + issueUrl + '|Here\'s the GitHub issue>'
41+
};
42+
43+
const slackCommunityEngagementPayload = {
44+
text: '📢 Feature ' + issueTitle + ' has been released! 🔗 <' + issueUrl + '|Here\'s the GitHub issue> \\n\\n • Reddit Advocacy Group check it out and help us spread the word! \\n\\n • Feature anchors, please engage with folks in the <https://discord.com/channels/1184987096302239844/1342205741926318080|#feature-spotlight> post for our new feature, and follow-up with interested users in <https://discord.com/channels/1184987096302239844/1331415710278221846|#ideas-and-issues> and <https://discord.com/channels/1184987096302239844/1340110387453886515|#codegate-users>'
4445
};
4546
4647
function sendNotification(webhookUrl, payload) {
47-
const url = new URL(webhookUrl);
48-
const req = https.request(url, {
49-
method: "POST",
48+
const req = https.request(webhookUrl, {
49+
method: 'POST',
5050
headers: {
51-
"Content-Type": "application/json",
51+
'Content-Type': 'application/json'
5252
}
5353
});
5454
55-
req.on("error", (error) => {
56-
console.error("Error:", error);
55+
req.on('error', (error) => {
56+
console.error('Error:', error);
5757
process.exit(1);
5858
});
5959
@@ -62,5 +62,6 @@ jobs:
6262
}
6363
6464
sendNotification(discordWebhook, discordPayload);
65-
sendNotification(slackWebhook, slackPayload);
66-
'
65+
sendNotification(slackCommunityReleaseWebhook, slackCommunityReleasePayload);
66+
sendNotification(slackCommunityEngagementWebhook, slackCommunityEngagementPayload);
67+
"

0 commit comments

Comments
 (0)