Skip to content

Commit 6aa2edd

Browse files
committed
Alt.
1 parent 5bd4f68 commit 6aa2edd

File tree

1 file changed

+8
-41
lines changed

1 file changed

+8
-41
lines changed

.github/workflows/push.yml

Lines changed: 8 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -33,48 +33,15 @@ jobs:
3333
# raco pkg install --auto www/
3434
raco make www/main.scrbl
3535
make -C www main
36-
- name: Generate assignment zips
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
39-
run: |
40-
curl -X POST \
41-
-H "Accept: application/vnd.github+json" \
42-
-H "Authorization: Bearer $GITHUB_TOKEN" \
43-
https://api.github.com/repos/cmsc430/assignments/actions/workflows/push.yml/dispatches \
44-
-d '{"ref":"main"}'
45-
- name: Get zips run ID
46-
env:
47-
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
48-
run: |
49-
sleep 60 # give chance to finish
50-
response=$(curl -s \
51-
-H "Accept: application/vnd.github+json" \
52-
-H "Authorization: token $GITHUB_TOKEN" \
53-
"https://api.github.com/repos/cmsc430/assignments/actions/runs?branch=main&status=success&per_page=1")
54-
echo "Run response: $response"
55-
run_id=$(echo "$response" | jq -r '.workflow_runs[0].id')
56-
echo "RUN_ID=$run_id" >> $GITHUB_ENV
5736
- name: Download assignment zips
58-
env:
59-
GITHUB_TOKEN: ${{ secrets.PAT_ZIPS_WORKFLOW }}
60-
run: |
61-
response=$(curl -s \
62-
-H "Accept: application/vnd.github+json" \
63-
-H "Authorization: token $GITHUB_TOKEN" \
64-
https://api.github.com/repos/cmsc430/assignments/actions/runs/${{ env.RUN_ID }}/artifacts)
65-
echo "Run response: $response"
66-
download_url=$(echo "$response" | jq -r '.artifacts[0].archive_download_url')
67-
echo "Download URL: $download_url"
68-
curl -L \
69-
-H "Accept: application/vnd.github+json" \
70-
-H "Authorization: token $GITHUB_TOKEN" \
71-
$download_url \
72-
-o artifacts.zip
73-
- name: Extract assignment zips
74-
run: |
75-
unzip artifacts.zip
76-
tar -xvf artifact.tar
77-
mv knock-plus.zip www/main/code/
37+
uses: Legit-Labs/action-download-artifact@v2
38+
with:
39+
github_token: ${{ secrets.PAT_ZIPS_WORKFLOW }}
40+
workflow: push.yml
41+
workflow_conclusion: success
42+
branch: main
43+
name: zips
44+
path: www/main/code
7845
- name: Archive www
7946
uses: actions/upload-pages-artifact@v3
8047
with:

0 commit comments

Comments
 (0)