Skip to content

Commit

Permalink
fix: github release install silently fails if no urls found (#571)
Browse files Browse the repository at this point in the history
Co-authored-by: Benjamin Sherman <[email protected]>
  • Loading branch information
bcook254 and bsherman authored Nov 17, 2024
1 parent 5635674 commit 4561ed4
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions github-release-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ API="https://api.github.com/repos/${ORG_PROJ}/releases/${RELTAG}"

# retry up to 5 times with 5 second delays for any error included HTTP 404 etc
curl --fail --retry 5 --retry-delay 5 --retry-all-errors -sL ${API} -o ${API_JSON}
RPM_URLS=$(cat ${API_JSON} \
RPM_URLS=($(cat ${API_JSON} \
| jq \
-r \
--arg arch_filter "${ARCH_FILTER}" \
'.assets | sort_by(.created_at) | reverse | .[] | select(.name|test($arch_filter)) | select (.name|test("rpm$")) | .browser_download_url')
for URL in ${RPM_URLS}; do
# WARNING: in case of multiple matches, this only installs the first matched release
echo "execute: rpm-ostree install \"${URL}\""
rpm-ostree install "${URL}"
break
done
'.assets | sort_by(.created_at) | reverse | .[] | select(.name|test($arch_filter)) | select(.name|test("rpm$")) | .browser_download_url'))
# WARNING: in case of multiple matches, this only installs the first matched release
echo "execute: rpm-ostree install \"${RPM_URLS[0]}\""
rpm-ostree install "${RPM_URLS[0]}"

0 comments on commit 4561ed4

Please sign in to comment.