Files
Robin van Boven ec09e6e85f feat: Add yq to act (#117)
* feat: update install script

* fix: revert toolset path

Since there's a lot of hard-coded references to this path.

* feat: Adds yq script

Unlike upstream we detect the arch suffix here.

* feat: include yq in act and custom flavors

* fix: include armhf in supported arch for act.yml

* fix: PR feedback, don't need to install twice for custom
2023-11-19 19:59:49 +01:00

30 lines
1.0 KiB
Bash
Executable File

#!/bin/bash -e
################################################################################
## File: yq.sh
## Desc: Installs YQ
## Supply chain security: YQ - checksum validation
################################################################################
# source: https://github.com/actions/runner-images/blob/5d6938f680075d63fa71f8aa70990866cd12884b/images/linux/scripts/installers/yq.sh
# Source the helpers for use with the script
. /imagegeneration/installers/helpers/install.sh
yq_arch() {
case "$(uname -m)" in
'aarch64') echo 'arm64' ;;
'x86_64') echo 'amd64' ;;
'armv7l') echo 'arm' ;;
*) exit 1 ;;
esac
}
# Download YQ
base_url="https://github.com/mikefarah/yq/releases/latest/download"
filename="yq_linux_$(yq_arch)"
download_with_retries "${base_url}/${filename}" "/tmp" "yq"
# Supply chain security - YQ
external_hash=$(get_hash_from_remote_file "${base_url}/checksums" "${filename} " "" " " "19")
use_checksum_comparison "/tmp/yq" "${external_hash}"
# Install YQ
sudo install /tmp/yq /usr/bin/yq