mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-20 06:29:50 +00:00
[Ubuntu] Add more checksum validations (#8660)
This commit is contained in:
@@ -2,17 +2,22 @@
|
||||
################################################################################
|
||||
## File: oras-cli.sh
|
||||
## Desc: Installs ORAS CLI
|
||||
## Supply chain security: ORAS CLI - checksum validation
|
||||
################################################################################
|
||||
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# Determine latest ORAS CLI version
|
||||
ORAS_CLI_DOWNLOAD_URL=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")")
|
||||
ORAS_CLI_ARCHIVE=$(basename $ORAS_CLI_DOWNLOAD_URL)
|
||||
URL=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")")
|
||||
archive_name=$(basename "${URL}")
|
||||
|
||||
# Install ORAS CLI
|
||||
cd /tmp
|
||||
download_with_retries $ORAS_CLI_DOWNLOAD_URL
|
||||
tar xzf $ORAS_CLI_ARCHIVE -C /usr/local/bin oras
|
||||
# Download ORAS CLI
|
||||
download_with_retries "${URL}" "/tmp" "${archive_name}"
|
||||
# Supply chain security - ORAS CLI
|
||||
hash_url=$(get_github_package_download_url "oras-project/oras" "contains(\"checksums.txt\")")
|
||||
external_hash=$(get_hash_from_remote_file "${hash_url}" "linux_amd64.tar.gz")
|
||||
use_checksum_comparison "/tmp/${archive_name}" "${external_hash}"
|
||||
# Unzip ORAS CLI
|
||||
tar xzf "/tmp/${archive_name}" -C /usr/local/bin oras
|
||||
|
||||
invoke_tests "CLI.Tools" "Oras CLI"
|
||||
|
||||
Reference in New Issue
Block a user