mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-28 04:20:23 +08:00
[Ubuntu] Rewrite function download_with_retry (#8912)
* [Ubuntu] Rewrite function download_with_retry * Fix loop exit condition
This commit is contained in:
committed by
GitHub
parent
7dba8776df
commit
abb81511d4
@@ -8,16 +8,17 @@
|
||||
source $HELPER_SCRIPTS/install.sh
|
||||
|
||||
# Determine latest ORAS CLI version
|
||||
URL=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")")
|
||||
archive_name=$(basename "${URL}")
|
||||
download_url=$(get_github_package_download_url "oras-project/oras" "endswith(\"linux_amd64.tar.gz\")")
|
||||
|
||||
# Download ORAS CLI
|
||||
download_with_retries "${URL}" "/tmp" "${archive_name}"
|
||||
archive_path=$(download_with_retry "$download_url")
|
||||
|
||||
# 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}"
|
||||
use_checksum_comparison "$archive_path" "${external_hash}"
|
||||
|
||||
# Unzip ORAS CLI
|
||||
tar xzf "/tmp/${archive_name}" -C /usr/local/bin oras
|
||||
tar xzf "$archive_path" -C /usr/local/bin oras
|
||||
|
||||
invoke_tests "CLI.Tools" "Oras CLI"
|
||||
|
||||
Reference in New Issue
Block a user