forked from european-modelling-hubs/flu-forecast-hub_archive
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (51 loc) · 1.43 KB
/
persist_changes.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: PersistChangesToJsonDB
on:
workflow_call:
inputs:
# input list of changes is a blank separated string
changes-list:
required: true
type: string
secrets:
# pass in the GITHUB_TOKEN
envPAT:
required: true
workflow_dispatch:
jobs:
persist_to_json_job:
runs-on: ubuntu-latest
steps:
- name: Trace the changes
run: |
echo "Changes: ${{ inputs.changes-list }}"
# Checkout the python tools repo
# used to authenticate and validate the PR
# -------------------------------------------
- name: checkout python tools repo
uses: actions/checkout@v3
with:
token: ${{ secrets.envPAT }}
repository: 'european-modelling-hubs/hub-tools'
ref: 'main'
path: './tools/'
- name: checkout data repo
uses: actions/checkout@v3
with:
token: ${{ secrets.envPAT }}
repository: 'european-modelling-hubs/flu-forecast-hub'
ref: 'main'
path: './repo/'
# Store changes
# -------------------------
- name: Store Changes
env:
data: ${{ inputs.changes-list }}
run: |
python ./tools/code/persist-changes.py
- name: Commit changes
uses: EndBug/add-and-commit@v7
with:
cwd: './repo'
message: "Update data storage"
default_author: github_actions
push: true