-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (42 loc) · 1.28 KB
/
load.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
45
46
47
48
49
50
---
name: Load data
on:
workflow_dispatch:
schedule:
# run every day at 02:00
- cron: '0 2 * * *'
jobs:
load:
runs-on: ubuntu-latest
name: Load project
environment: load
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Configure git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
- name: Install node 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: npm
- name: Install project modules
run: npm ci
- name: Load contributions
env:
ORG_GITHUB_TOKEN: ${{ secrets.ORG_GITHUB_TOKEN }}
run: npm run load-contributions
- name: Verify new contributions
id: verify_contributions
# exit-code will exit 1 if found diff
run: git diff --exit-code src/resources/contributions.json
continue-on-error: true
- name: Push new contributions
# failure (exit 1) means diff found - needs to push
if: steps.verify_contributions.outcome == 'failure'
run: |
git add src/resources/contributions.json
git commit -m "chore: updated contributions"
git push origin HEAD