-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Install slsa-provenance instead of using docker image
This to resolve workflows that require docker login Signed-off-by: Marco Franssen <[email protected]>
- Loading branch information
1 parent
fb25466
commit e6280d8
Showing
4 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ coverage.out | |
.DS_Store | ||
.env | ||
cosign.key | ||
.slsa-provenance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
VERSION=v0.6.0 | ||
RELEASE="https://github.com/philips-labs/slsa-provenance-action/releases/download/${VERSION}" | ||
OS=${RUNNER_OS:-linux} | ||
ARCH=${RUNNER_ARCH:-amd64} | ||
INSTALL_PATH="$(realpath "${INSTALL_PATH:-./.slsa-provenance}")" | ||
|
||
echo "Installing slsa-provenance at ${INSTALL_PATH}/bin" | ||
|
||
if [ "${OS}" == "Windows" ] ; then | ||
OS=windows | ||
elif [ "${OS}" == "Linux" ] ; then | ||
OS=linux | ||
fi | ||
|
||
if [ "${ARCH}" == "x64" ] ; then | ||
ARCH=amd64 | ||
fi | ||
|
||
mkdir -p "$INSTALL_PATH/bin" | ||
pushd "$INSTALL_PATH" > /dev/null || exit | ||
|
||
echo "Downloading slsa-provenance_${VERSION/v}_${OS}_${ARCH}.tar.gz" | ||
curl -sLo slsa-provenance.tar.gz "$RELEASE/slsa-provenance_${VERSION/v}_${OS}_${ARCH}.tar.gz" | ||
|
||
if [ -x "$(command -v cosign)" ] ; then | ||
echo "Downloading slsa-provenance_${VERSION/v}_${OS}_${ARCH}.tar.gz.sig" | ||
curl -sLo slsa-provenance.tar.gz.sig "$RELEASE/slsa-provenance_${VERSION/v}_${OS}_${ARCH}.tar.gz.sig" | ||
echo "Downloading cosign.pub" | ||
curl -sLo cosign.pub "$RELEASE/cosign.pub" | ||
|
||
cosign verify-blob --key cosign.pub --signature slsa-provenance.tar.gz.sig slsa-provenance.tar.gz | ||
else | ||
echo >&2 | ||
echo " cosign binary not installed in PATH. Unable to verify signature" >&2 | ||
echo >&2 | ||
fi | ||
|
||
tar -xzf slsa-provenance.tar.gz | ||
mv "$INSTALL_PATH/slsa-provenance" "$INSTALL_PATH/bin" | ||
|
||
# for testing purposes fall back to "$INSTALL_PATH/GITHUB_PATH" | ||
echo "$INSTALL_PATH/bin" >> "${GITHUB_PATH:-"$INSTALL_PATH/GITHUB_PATH"}" | ||
|
||
popd > /dev/null || exit | ||
|