-
Notifications
You must be signed in to change notification settings - Fork 13
75 lines (58 loc) · 1.94 KB
/
store_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
66
67
68
69
70
71
72
73
74
75
name: Persist Forecasts and target data changes to json
on:
workflow_run:
workflows: [ValidateSubmission, ValidateSurveillance, GenerateEnsemble, GenerateBaseline]
types:
- completed
workflow_dispatch:
jobs:
update_json_changes:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Download workflow artifact
uses: dawidd6/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: validate-submission.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Read the changes from artifacts
id: pr_changes_reader
uses: juliangruber/[email protected]
with:
path: ./pr_changes/pr_changes.json
- name: Trace the changes
run: |
echo "Changes: ${{ steps.pr_changes_reader.outputs.content }}"
# Checkout the python tools repo
# used to authenticate and validate the PR
# -------------------------------------------
- name: checkout python tools repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'Predizioni-Epidemiologiche-Italia/hub-tools'
ref: 'main'
path: './tools/'
- name: checkout data repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
# token: ${{ secrets.WF_PR_PAT }}
repository: 'Predizioni-Epidemiologiche-Italia/Influcast'
ref: 'main'
path: './repo/'
# Store changes
# -------------------------
- name: Store Changes
env:
data: ${{ steps.pr_changes_reader.outputs.content }}
run: |
python ./tools/code/store_changes.py
- name: Commit changes
uses: EndBug/add-and-commit@v7
with:
cwd: './repo'
message: "Update data storage"
default_author: github_actions
push: true