Skip to content

Commit

Permalink
modified after-validate-submission.yaml to change the trigger cond us…
Browse files Browse the repository at this point in the history
…ing github.event.pull_request.merged and its closure
  • Loading branch information
kjsato committed Mar 6, 2024
1 parent 987fc43 commit e92be84
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/after-validate-submission.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down

0 comments on commit e92be84

Please sign in to comment.