Skip to content

Persist Forecasts and meta-data changes to json #22

Persist Forecasts and meta-data changes to json

Persist Forecasts and meta-data changes to json #22

Workflow file for this run

name: Persist Forecasts and meta-data changes to json
on:
workflow_run:
workflows: [HubSubmissionValidation(R), ImportTruthErviss, DownloadFluID, GenerateBaseline, GenerateEnsemble, 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/action-download-artifact@v2.11.0
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/read-file-action@v1.0.0
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/ari-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