mirror of
https://github.com/KieSun/all-of-frontend.git
synced 2024-11-14 10:58:13 +08:00
23 lines
504 B
JavaScript
23 lines
504 B
JavaScript
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;
|
|
|
|
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,
|
|
});
|
|
}
|
|
}
|