forked from twitter/opensource-website
-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (36 loc) · 1.1 KB
/
update-data.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
name: Update data
on:
workflow_dispatch: {}
schedule:
# Run Mondays at 2:45 am
- cron: "45 2 * * 1"
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# update stats
- uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install -r requirements.txt
# Eventually call scripts/fetch_augur_metrics.py and
# scripts/fetch_year_in_review.py as well when possible
- run: python scripts/fetch_projects.py
env:
OAUTH_TOKEN: ${{ secrets.GH_API_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
- run: |
git config user.name 'GitHub Actions'
git config user.email 'actions@users.noreply.github.com'
git add -A
timestamp=$(date -u)
git commit -m "update data: ${timestamp}" || exit 0
git push