Skip to content

Commit

Permalink
ci: actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KieSun committed Mar 22, 2021
1 parent 1df8461 commit 27fc8e2
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on:
issues:
types: [opened, edited]

jobs:
issue:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
ISSUEHOST: ${{ secrets.ISSUE }}
run: node ./script/issue.js
26 changes: 0 additions & 26 deletions 1.js

This file was deleted.

12 changes: 12 additions & 0 deletions script/issue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { event: { issue, action } } = JSON.parse(process.env.GITHUB_CONTEXT)
const { author_association, body, title, number } = issue

console.log(process.env.ISSUEHOST)

if (author_association === 'OWNER') {
if (action === 'edited') {
console.log(body, title, number, '----edited')
} else if (action === 'opened') {
console.log(body, title, number, '----opened')
}
}

0 comments on commit 27fc8e2

Please sign in to comment.