Skip to content

Commit

Permalink
Dat 16952 (#166)
Browse files Browse the repository at this point in the history
* fix(get_draft_release.sh): filter draft release by version name to ensure correct release is retrieved
fix(get_draft_release.sh): correctly extract upload URL from draft release object

* fix(get_draft_release.sh): update API request to fetch only the latest draft release to improve efficiency and accuracy in retrieving draft releases.
  • Loading branch information
jandroav authored Feb 19, 2024
1 parent dca3642 commit 825cadd
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 @@ -17,8 +17,8 @@ fi
RELEASE=$(curl -s \
-H "Authorization: token $GITHUB_TOKEN" \
-H "Accept: application/vnd.github+json" \
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases" |
jq -r --arg VERSION "$VERSION" '.[] | select(.draft == true and .name == $VERSION)')
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases?per_page=1" |
jq -r 'if .[].draft == true then .[].id else empty end')

if [[ "${#RELEASE}" -eq 0 ]]; then
echo "Draft release not found."
Expand Down

0 comments on commit 825cadd

Please sign in to comment.