Skip to content

Persist Forecasts and meta-data changes to json #34

Persist Forecasts and meta-data changes to json

Persist Forecasts and meta-data changes to json #34

Workflow file for this run

name: Persist Forecasts and meta-data changes to json
on:
workflow_run:
workflows: [HubSubmissionValidation(R), ImportTruthErviss, DownloadFluID, Scoring]
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: test only
# id: pr_changes_reader
# run: |
# echo content="model-metadata/ISI-AutoArima.yml model-output/Test1-SIRModel/2023-11-11-Test1-SIRModel.csv" >> $GITHUB_OUTPUT
- 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: 'european-modelling-hubs/hub-tools'
ref: 'main'
path: './tools/'
- name: checkout data repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 'european-modelling-hubs/flu-forecast-hub'
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