-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (50 loc) · 1.37 KB
/
fetch.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
name: Get daily stats
on:
schedule:
- cron: "0 0 * * *"
jobs:
cron:
runs-on: ubuntu-latest
steps:
- name: Git clone
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Fetch
env:
PAT: ${{ secrets.PAT }}
shell: bash
run: ./scripts/fetch.sh
- name: Score
env:
PAT: ${{ secrets.PAT }}
shell: bash
run: |
today=$(./scripts/utils/today.sh)
sevenDaysAgo=$(./scripts/utils/sevenDaysAgo.sh)
echo $today
echo $sevenDaysAgo
./scripts/score.sh data/$today data/$sevenDaysAgo
sort -nr score-output > data/"$today"-score
rm score-output
- name: Chart
env:
PAT: ${{ secrets.PAT }}
shell: bash
run: |
today=$(./scripts/utils/today.sh)
yesterday=$(./scripts/utils/yesterday.sh)
echo $today
echo $yesterday
./scripts/diffs.sh $today $yesterday > README.md
rm today today-nr yesterday yesterday-nr
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: GitHub Commit & Push
uses: actions-js/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }}