all-of-frontend/script/issue.js

23 lines
504 B
JavaScript
Raw Permalink Normal View History

2021-03-23 10:50:25 +08:00
const axios = require("axios");
const {
event: { issue, action },
} = JSON.parse(process.env.GITHUB_CONTEXT);
const { author_association, body, title, number } = issue;
const host = process.env.ISSUEHOST;
2021-03-22 21:42:21 +08:00
2021-03-23 10:50:25 +08:00
if (author_association === "OWNER") {
if (action === "edited") {
axios.put(host, {
name: title,
issueId: number,
content: body,
});
} else if (action === "opened") {
axios.post(host, {
name: title,
issueId: number,
content: body,
});
}
}