@@ -46,26 +46,43 @@ jobs:
4646 unzip -o package.zip
4747 rm -f package.zip
4848
49- - name : Create hlp/ directory
50- run : mkdir -p hlp
49+ - name : Create hlp/ directories
50+ run : |
51+ mkdir -p hlp
52+ mkdir -p hlp-user
5153
5254 - name : Download all zip assets from HelpViewer/helpHello
5355 env :
5456 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
5557 run : |
5658 release_name="${{ github.event.inputs.release_name }}"
57- api_url="https://api.github.com/repos/HelpViewer/helpHello/releases/tags/$release_name"
59+
60+ _reponame=helpHello
61+ api_url="https://api.github.com/repos/HelpViewer/$_reponame/releases/tags/$release_name"
5862 release=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$api_url")
63+ hlpdir=hlp
5964
60- mkdir -p hlp
65+ echo "$release" | jq -c '.assets[] | select(.name | endswith(".zip"))' | while read asset; do
66+ name=$(echo "$asset" | jq -r '.name')
67+ url=$(echo "$asset" | jq -r '.url')
68+ echo "Downloading $name..."
69+ curl -L -H "Accept: application/octet-stream" \
70+ -H "Authorization: token $GITHUB_TOKEN" \
71+ "$url" -o "$hlpdir/$name"
72+ done
73+
74+ _reponame=helpUser
75+ api_url="https://api.github.com/repos/HelpViewer/$_reponame/releases/latest"
76+ release=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "$api_url")
77+ hlpdir=hlp-user
6178
6279 echo "$release" | jq -c '.assets[] | select(.name | endswith(".zip"))' | while read asset; do
6380 name=$(echo "$asset" | jq -r '.name')
6481 url=$(echo "$asset" | jq -r '.url')
6582 echo "Downloading $name..."
6683 curl -L -H "Accept: application/octet-stream" \
6784 -H "Authorization: token $GITHUB_TOKEN" \
68- "$url" -o "hlp /$name"
85+ "$url" -o "$hlpdir /$name"
6986 done
7087
7188 - name : Commit and push changes
0 commit comments