Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use raw output from jq to install cosign again #312

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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