Skip to content

Commit 6e55ca1

Browse files
authored
Update toPages.yml - developer guide download added
1 parent 4a26d35 commit 6e55ca1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/toPages.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,20 @@ jobs:
100100
"$url" -o "$hlpdir/$name"
101101
done
102102
103+
_reponame=helpDevelop
104+
api_url="https://api.github.com/repos/HelpViewer/$_reponame/releases/latest"
105+
release=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$api_url")
106+
hlpdir=hlp-dguide
107+
108+
echo "$release" | jq -c '.assets[] | select(.name | endswith(".zip"))' | while read asset; do
109+
name=$(echo "$asset" | jq -r '.name')
110+
url=$(echo "$asset" | jq -r '.url')
111+
echo "Downloading $name..."
112+
curl -L -H "Accept: application/octet-stream" \
113+
-H "Authorization: token $GITHUB_TOKEN" \
114+
"$url" -o "$hlpdir/$name"
115+
done
116+
103117
- name: Commit and push changes
104118
run: |
105119
git config user.name "github-actions[bot]"

0 commit comments

Comments
 (0)