询问解决方案。没有国内的云主机,也不想自己写一个 server。 脚本用的是 typescript,关键代码大概这样:
const writeFile = util.promisify(fs.writeFile)
await writeFile(`${repoPath}/${name}.html`, article)
await exec(`cd ${repoPath}; git pull; git add --all; git commit -m "auto commit" && git push origin master`)