-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (35 loc) · 1010 Bytes
/
daily.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
name: daily-update
on:
push:
schedule:
- cron: "*/3 * * * *"
permissions:
contents: write
jobs:
hackernews-daily:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm install --only=prod
working-directory: .
- name: Get fresh HackerNews
run: node ./feeds/hackernews-daily/index.js
# you need git commit to push the forks data to the repo
- name: Git commit
run: |
# git commit if there's any change
if test -n "$(git status --porcelain 2>/dev/null)"; then
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "Update Hacker News daily top data"
git pull
git push origin main
fi