diff --git a/.github/workflows/after-validate-submission.yaml b/.github/workflows/after-validate-submission.yaml index a1a6fa90..df7e98a6 100644 --- a/.github/workflows/after-validate-submission.yaml +++ b/.github/workflows/after-validate-submission.yaml @@ -1,15 +1,19 @@ name: After Validate Submission Workflow on: - workflow_run: - workflows: ["Hub Submission Validation (R)"] # The name of the workflow we want to trigger from + #workflow_run: + # workflows: ["Hub Submission Validation (R)"] # The name of the workflow we want to trigger from + # types: + # - completed + pull_request: types: - - completed + - closed jobs: copy-files-to-rsv-data-repo: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # if: ${{ github.event.workflow_run.conclusion == 'success' }} + if: github.event.pull_request.merged == true steps: - name: Checkout uses: actions/checkout@v2 @@ -20,16 +24,15 @@ jobs: uses: actions/checkout@v2 with: repository: HopkinsIDD/rsv-forecast-hub_data + #repository: kjsato/rsv-forecast-hub_data token: ${{ secrets.KJ3_PATC }} path: ./rsv-forecast-hub_data fetch-depth: 2 - name: Copy new files run: | - FILES=$(git diff --name-only HEAD^ HEAD) - for FILE in $FILES - do - if [[ $FILE == model-output/* ]] || [[ $FILE == model-metadata/* ]]; then + for FILE in model-output/**/* model-metadata/*; do + if [ -f "$FILE" ]; then mkdir -p ./rsv-forecast-hub_data/$(dirname $FILE) cp $FILE ./rsv-forecast-hub_data/$FILE fi