blob: ed10b1cc38843a2004b2946501f6d1d87818b9f4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import { fetchAsync } from '@0x/utils';
import { constants } from '../constants';
import { utils } from './utils';
export const alertDiscordAsync = async (releaseNotes: string): Promise<boolean> => {
const webhookUrl = constants.discordAlertWebhookUrl;
if (!webhookUrl) {
utils.log('Not alerting to discord because webhook url not set');
return false;
}
utils.log('Alerting discord...');
const payload = {
content: `New monorepo package released! View at ${constants.releasesUrl} \n\n ${releaseNotes}`,
};
await fetchAsync(webhookUrl, {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify(payload),
});
return true;
};
|