-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (36 loc) · 1.3 KB
/
issue-event.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: ISSUE
on:
issues:
types: [opened, edited, deleted, labeled, unlabeled]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js 16
uses: actions/setup-node@v2-beta
with:
node-version: '16'
- name: Install Deps
run: npm install @actions/github
- name: Commit files
if: github.event.action == 'opened' || github.event.action == 'edited' || github.event.action == 'labeled' || github.event.action == 'unlabeled'
run: |
node ./script/update-issue.js
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add ./content
git commit -a -m "update content/posts/${{ github.event.issue.number }}.md"
- name: Commit files
if: github.event.action == 'deleted'
run: |
node ./script/update-issue.js
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git rm ./content/posts/${{ github.event.issue.number }}.md
git commit -a -m "remove content/posts/${{ github.event.issue.number }}.md"
- name: Push changes
run: git push