Skip to content

Commit 03756af

Browse files
authored
Update toPages.yml : Authors guide is downloading to pages
1 parent a831f99 commit 03756af

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/toPages.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
run: |
5151
mkdir -p hlp
5252
mkdir -p hlp-user
53+
mkdir -p hlp-aguide
5354
5455
- name: Download all zip assets from HelpViewer/helpHello
5556
env:
@@ -85,6 +86,20 @@ jobs:
8586
"$url" -o "$hlpdir/$name"
8687
done
8788
89+
_reponame=helpAuthorsGuide
90+
api_url="https://api.github.com/repos/HelpViewer/$_reponame/releases/latest"
91+
release=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$api_url")
92+
hlpdir=hlp-aguide
93+
94+
echo "$release" | jq -c '.assets[] | select(.name | endswith(".zip"))' | while read asset; do
95+
name=$(echo "$asset" | jq -r '.name')
96+
url=$(echo "$asset" | jq -r '.url')
97+
echo "Downloading $name..."
98+
curl -L -H "Accept: application/octet-stream" \
99+
-H "Authorization: token $GITHUB_TOKEN" \
100+
"$url" -o "$hlpdir/$name"
101+
done
102+
88103
- name: Commit and push changes
89104
run: |
90105
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)