-
-
Notifications
You must be signed in to change notification settings - Fork 24
49 lines (39 loc) · 1.18 KB
/
auto-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
42
43
44
45
46
47
48
49
name: Update local-specific data
on:
schedule:
# At 00:00 (UTC) every day
- cron: "0 0 * * *"
# Allow to call the workflow manually
workflow_dispatch:
jobs:
auto-update-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt', 'requirements-tests.txt') }}
- name: Install requirements
if: steps.cache.outputs.cache-hit != 'true'
run: python -m pip install -r requirements-tests.txt
- name: Update data
id: update-data
run: |
python -m scripts
./check.sh || true
- name: Push changes
uses: Automattic/action-commit-to-branch@master
with:
branch: master
commit_message: "Update locale-specific data"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Fail on error
if: steps.update-data.outputs.errors != '0'
run: exit 1