blob: 116b1b90874c34b91a145e7479b66d77e1f4fed1 (
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 alertDiscord = 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;
};
|