Persist Forecasts and target data changes to json #92
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |