Skip to content

Commit dc905cd

Browse files
committed
Fixing issue with new release workflow
1 parent 19751ef commit dc905cd

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/release.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -202,20 +202,23 @@ jobs:
202202
run: |
203203
# github api url
204204
url=https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/${{ steps.generate_release_notes.outputs.id }}
205+
echo "url: $url"
205206
206207
# get release notes
207-
body=$(
208+
release=$(
208209
curl \
209210
-s \
210211
-L \
211212
-H "Accept: application/vnd.github+json" \
212213
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
213214
-H "X-GitHub-Api-Version: 2022-11-28" \
214-
$url \
215-
| jq -r .body
215+
$url
216216
)
217+
tag_name=$(jq -r .tag_name <<< "$release")
218+
target_commitish=$(jq -r .target_commitish <<< "$release")
219+
body=$(jq -r .body <<< "$release")
217220
218-
echo -e ">>>\n$body\n<<<"
221+
echo "tag_name: $tag_name target_commitish: $target_commitish"
219222
220223
# append virustotal details to release notes
221224
nl=$'\n'
@@ -226,17 +229,19 @@ jobs:
226229
body+="* [$name]($vturl)$nl"
227230
done <<< "${{ steps.virustotal.outputs.analysis }}"
228231
229-
# update release notes
230-
export body
231-
echo -e ">>>\n$body\n<<<"
232+
echo -e "body:\n$body"
232233
234+
# update release notes
235+
export tag_name target_commitish body
233236
curl \
234237
-s \
235238
-L \
236239
-X PATCH \
237240
-H "Accept: application/vnd.github+json" \
238241
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
239242
-H "X-GitHub-Api-Version: 2022-11-28" \
243+
--variable '%tag_name' \
244+
--varable '%target_commitish' \
240245
--variable '%body' \
241-
--expand-data '{"body": "{{body:trim:json}}"}' \
246+
--expand-data '{"tag_name": "{{tag_name:json}}", "body": "{{body:trim:json}}"}' \
242247
$url

0 commit comments

Comments
 (0)