Skip to content

Persist Forecasts and target data changes to json #59

Persist Forecasts and target data changes to json

Persist Forecasts and target data changes to json #59

Workflow file for this run

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/action-download-artifact@v6
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@v9
with:
cwd: './repo'
message: "Update data storage"
default_author: github_actions
push: true