diff --git a/gha-script/scanner-scripts/trivy_code_scan.sh b/gha-script/scanner-scripts/trivy_code_scan.sh index c4f4c09..66a6303 100644 --- a/gha-script/scanner-scripts/trivy_code_scan.sh +++ b/gha-script/scanner-scripts/trivy_code_scan.sh @@ -8,7 +8,7 @@ docker pull "$DOCKER_IMAGE" if [ "$validate_build_script" == true ]; then echo "[INFO] Fetching latest Trivy version..." - TRIVY_VERSION=$(curl -s https://api.github.com/repos/aquasecurity/trivy/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') + TRIVY_VERSION=$(curl -s https://api.github.com/repos/aquasecurity/trivy/releases/latest | awk -F'"' '$2=="tag_name" {print $4}') FILE_NAME="trivy_${TRIVY_VERSION#v}_Linux-s390x.tar.gz" CHECKSUM_FILE="trivy_${TRIVY_VERSION#v}_checksums.txt" diff --git a/gha-script/scanner-scripts/trivy_image_scan.sh b/gha-script/scanner-scripts/trivy_image_scan.sh index d63d70d..d6327d3 100755 --- a/gha-script/scanner-scripts/trivy_image_scan.sh +++ b/gha-script/scanner-scripts/trivy_image_scan.sh @@ -7,7 +7,7 @@ docker pull "$DOCKER_IMAGE" if [ "$build_docker" == true ]; then echo "Fetching latest Trivy version..." - TRIVY_VERSION=$(curl -s https://api.github.com/repos/aquasecurity/trivy/releases/latest | grep -Po '"tag_name": "\K.*?(?=")') + TRIVY_VERSION=$(curl -s https://api.github.com/repos/aquasecurity/trivy/releases/latest | awk -F'"' '$2=="tag_name" {print $4}') FILE_NAME="trivy_${TRIVY_VERSION#v}_Linux-s390x.tar.gz" CHECKSUM_FILE="trivy_${TRIVY_VERSION#v}_checksums.txt"