chore: action

This commit is contained in:
虚无 2021-03-23 11:04:05 +08:00
parent 45b0967015
commit bbb46d851e
2 changed files with 21 additions and 22 deletions

View File

@ -11,7 +11,7 @@ jobs:
- name: Dump GitHub context - name: Dump GitHub context
env: env:
GITHUB_CONTEXT: ${{ toJSON(github) }} GITHUB_CONTEXT: ${{ toJSON(github) }}
ISSUEHOST: ${{ secrets.ISSUEHOST }} COMMENTHOST: ${{ secrets.COMMENTHOST }}
run: | run: |
yarn yarn
node ./script/issue.js node ./script/comment.js

View File

@ -1,24 +1,23 @@
const axios = require("axios"); const axios = require("axios");
const { const {
event: { issue, action }, event: { comment },
} = JSON.parse(process.env.GITHUB_CONTEXT); } = JSON.parse(process.env.GITHUB_CONTEXT);
const { author_association, body, title, number } = issue; const {
const host = process.env.ISSUEHOST; 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);); axios.post(host, {
issueId: number,
// if (author_association === "OWNER") { commentId: id,
// if (action === "edited") { htmlUrl: html_url,
// axios.put(host, { userName: login,
// name: title, avatarUrl: avatar_url,
// issueId: number, content: body,
// content: body, updatedAt: updated_at,
// }); });
// } else if (action === "opened") {
// axios.post(host, {
// name: title,
// issueId: number,
// content: body,
// });
// }
// }