generated from hubverse-org/hubTemplate
-
Notifications
You must be signed in to change notification settings - Fork 12
55 lines (50 loc) · 1.64 KB
/
after-validate-submission.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: After Validate Submission Workflow
on:
#workflow_run:
# workflows: ["Hub Submission Validation (R)"] # The name of the workflow we want to trigger from
# types:
# - completed
pull_request_target:
types:
- closed
jobs:
copy-files-to-rsv-data-repo:
runs-on: ubuntu-latest
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
if: github.event.pull_request.merged == true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Checkout and push to another repository
uses: actions/checkout@v2
with:
#repository: kjsato/rsv-forecast-hub_data
repository: HopkinsIDD/rsv-forecast-hub_data
token: ${{ secrets.KJ3_PATC }}
path: ./rsv-forecast-hub_data
fetch-depth: 2
ref: main
- name: Copy new files
run: |
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
done
- name: Commit and push new files
run: |
cd ./rsv-forecast-hub_data
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Upload new files to RSV data repo"
git push
echo "RSV data uploaded";
else
echo "no upload";
fi
shell: bash