Skip to content

Commit

Permalink
fix: use raw output from jq to install cosign again (ublue-os#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
bsherman authored Aug 24, 2023
1 parent ffac5c4 commit 9b12fd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ else
fi

## install packages direct from github
/tmp/github-release-install.sh sigstore/cosign x86_64.rpm
/tmp/github-release-install.sh sigstore/cosign x86_64
7 changes: 5 additions & 2 deletions github-release-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,17 @@ if [ -z ${ARCH_FILTER} ]; then
exit 2
fi

set -ouex pipefail

API="https://api.github.com/repos/${ORG_PROJ}/releases/latest"
RPM_URLS=$(curl -sL ${API} \
| 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}
echo "execute: rpm-ostree install \"${URL}\""
rpm-ostree install "${URL}"
break
done

0 comments on commit 9b12fd5

Please sign in to comment.