refactor: project tsconfig & abstract infra type (#2721)

This commit is contained in:
Himself65
2023-06-08 12:41:47 +08:00
committed by GitHub
parent 05288be934
commit 1ad2e629ac
14 changed files with 149 additions and 207 deletions
+14 -12
View File
@@ -1,18 +1,20 @@
import got from 'got';
const STAGE_HOST = 'https://nightly.affine.pro/';
if (['master', 'develop'].includes(process.env.CF_PAGES_BRANCH)) {
const message = `Daily builds: New deployment of version ${process.env.CF_PAGES_COMMIT_SHA} was deploy: [nightly](${STAGE_HOST}) / [internal](${process.env.CF_PAGES_URL})`;
const url = `https://api.telegram.org/bot${process.env.BOT_TOKEN}/sendMessage`;
got
.post(url, {
json: {
chat_id: process.env.CHAT_ID,
text: message,
parse_mode: 'Markdown',
disable_notification: true,
},
})
.then(r => console.log(r.body));
fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
chat_id: process.env.CHAT_ID,
text: message,
parse_mode: 'Markdown',
disable_notification: true,
}),
})
.then(r => r.json())
.then(console.log);
}