-
Notifications
You must be signed in to change notification settings - Fork 633
45 lines (37 loc) · 1.04 KB
/
push.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: Push
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Run tests
run: npm start
gen-readme:
name: Create README
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
- name: Write README
run: npm start
- name: Commit README
run: |
# git commit if there's any change
if test -n "$(git status --porcelain 2>/dev/null)"; then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Apply $(git rev-parse --short HEAD) to README" -a
fi
- name: Push README
if: github.ref == 'refs/heads/master'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}