mirror of
https://github.com/KieSun/all-of-frontend.git
synced 2024-12-12 09:54:36 +08:00
chore: action
This commit is contained in:
parent
45b0967015
commit
bbb46d851e
4
.github/workflows/comment.yml
vendored
4
.github/workflows/comment.yml
vendored
@ -11,7 +11,7 @@ jobs:
|
||||
- name: Dump GitHub context
|
||||
env:
|
||||
GITHUB_CONTEXT: ${{ toJSON(github) }}
|
||||
ISSUEHOST: ${{ secrets.ISSUEHOST }}
|
||||
COMMENTHOST: ${{ secrets.COMMENTHOST }}
|
||||
run: |
|
||||
yarn
|
||||
node ./script/issue.js
|
||||
node ./script/comment.js
|
||||
|
@ -1,24 +1,23 @@
|
||||
const axios = require("axios");
|
||||
const {
|
||||
event: { issue, action },
|
||||
event: { comment },
|
||||
} = JSON.parse(process.env.GITHUB_CONTEXT);
|
||||
const { author_association, body, title, number } = issue;
|
||||
const host = process.env.ISSUEHOST;
|
||||
const {
|
||||
body,
|
||||
updated_at,
|
||||
html_url,
|
||||
id,
|
||||
user: { avatar_url, login },
|
||||
issue: { number },
|
||||
} = comment;
|
||||
const host = process.env.COMMENTHOST;
|
||||
|
||||
console.log(JSON.parse(process.env.GITHUB_CONTEXT););
|
||||
|
||||
// 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,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
axios.post(host, {
|
||||
issueId: number,
|
||||
commentId: id,
|
||||
htmlUrl: html_url,
|
||||
userName: login,
|
||||
avatarUrl: avatar_url,
|
||||
content: body,
|
||||
updatedAt: updated_at,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user