all-of-frontend/script/comment.js

26 lines
433 B
JavaScript
Raw Normal View History

2021-03-23 10:50:25 +08:00
const axios = require("axios");
const {
2021-03-23 11:33:40 +08:00
event: {
comment,
issue: { number },
},
2021-03-23 10:50:25 +08:00
} = JSON.parse(process.env.GITHUB_CONTEXT);
2021-03-23 11:04:05 +08:00
const {
body,
updated_at,
html_url,
id,
user: { avatar_url, login },
} = comment;
const host = process.env.COMMENTHOST;
2021-03-23 10:50:25 +08:00
2021-03-23 11:04:05 +08:00
axios.post(host, {
issueId: number,
commentId: id,
htmlUrl: html_url,
userName: login,
avatarUrl: avatar_url,
content: body,
updatedAt: updated_at,
});