Skip to content

Commit

Permalink
fix(get_draft_release.sh): filter draft release by version name to en…
Browse files Browse the repository at this point in the history
…sure correct release is retrieved (#165)

fix(get_draft_release.sh): correctly extract upload URL from draft release object
  • Loading branch information
jandroav authored Feb 19, 2024
1 parent 1043bab commit dca3642
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/get_draft_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ RELEASE=$(curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases" |
jq -r ".[] | select(.draft == true)")
jq -r --arg VERSION "$VERSION" '.[] | select(.draft == true and .name == $VERSION)')

if [[ "${#RELEASE}" -eq 0 ]]; then
echo "Draft release not found."
Expand All @@ -31,7 +31,7 @@ case $KEY in
echo "$HTML_URL" | rev | cut -d "/" -f1 | rev
;;
UPLOAD_URL)
UPLOAD_URL=$(echo $RELEASE | jq -r 'first(.upload_url)')
UPLOAD_URL=$(echo $RELEASE | jq -r '.upload_url')
echo "${UPLOAD_URL//{?name,label\}}"
;;
esac

0 comments on commit dca3642

Please sign in to comment.