From 7a770aa7b522eeea34e2871df17bc315fb0bc4e7 Mon Sep 17 00:00:00 2001 From: Matthew Meszaros Date: Sun, 1 Nov 2026 14:18:23 +0100 Subject: [PATCH] feat: keep runtime TLS recovery archive and execution tests portable across CI runners --- .github/scripts/runtime-tls-recovery-archive.test.sh | 2 +- .github/scripts/runtime-tls-recovery-execute.test.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/scripts/runtime-tls-recovery-archive.test.sh b/.github/scripts/runtime-tls-recovery-archive.test.sh index a4a1ad70d..e62c0cd13 100755 --- a/.github/scripts/runtime-tls-recovery-archive.test.sh +++ b/.github/scripts/runtime-tls-recovery-archive.test.sh @@ -19,7 +19,7 @@ while [ "$#" -gt 0 ]; do case "$1" in --checksum-sha256) checksum=$2; shift 2 ;; --body) body=$2; shift 2 ;; *) shift ;; esac done [ "$checksum" = "$(openssl dgst -sha256 -binary "$body" | openssl base64 -A)" ] -tar -tzf "$body" | rg -q '^./full-raw.json$' +tar -tzf "$body" | grep -Fx './full-raw.json' >/dev/null if [ "${MODE:-}" = upload ]; then exit 1; fi jq -n --arg checksum "$checksum" --arg mode "${MODE:-}" '{VersionId:"evidence-version",ServerSideEncryption:"AES256",ChecksumSHA256:(if $mode=="checksum" then "other" else $checksum end)}' SH diff --git a/.github/scripts/runtime-tls-recovery-execute.test.sh b/.github/scripts/runtime-tls-recovery-execute.test.sh index e7e9a0273..2cf4d73f7 100755 --- a/.github/scripts/runtime-tls-recovery-execute.test.sh +++ b/.github/scripts/runtime-tls-recovery-execute.test.sh @@ -142,7 +142,7 @@ for mode in bypass self-review artifact provenance live advanced scope changes; if WORK="$work/$mode" MODE=$mode APPROVED_DIGEST="$approved" bash "$guard" apply 2>/dev/null; then echo "Recovery applied incompatible evidence: $mode" >&2; exit 1 fi - if rg -q '^terraform .* apply ' "$work/requests.log"; then echo "Recovery reached apply for $mode" >&2; exit 1; fi + if grep -q '^terraform .* apply ' "$work/requests.log"; then echo "Recovery reached apply for $mode" >&2; exit 1; fi done if WORK="$work/wrong-approval" APPROVED_DIGEST=other bash "$guard" apply 2>/dev/null; then echo 'Recovery accepted another approval digest' >&2; exit 1; fi if WORK="$work/retry" GITHUB_RUN_ATTEMPT=2 bash "$guard" plan 2>/dev/null; then echo 'Recovery accepted a rerun' >&2; exit 1; fi @@ -152,12 +152,12 @@ if WORK="$work/apply-failure" MODE=apply-failure APPROVED_DIGEST="$approved" bas echo 'Recovery continued after an apply failure' >&2; exit 1 fi [ ! -e "$work/applied" ] -if rg -q '^live collect-final$' "$work/requests.log"; then echo 'Recovery verified a failed apply as complete' >&2; exit 1; fi +if grep -q '^live collect-final$' "$work/requests.log"; then echo 'Recovery verified a failed apply as complete' >&2; exit 1; fi : >"$work/requests.log" WORK="$work/apply" APPROVED_DIGEST="$approved" bash "$guard" apply -[ "$(rg -c '^live collect$' "$work/requests.log")" = 2 ] -[ "$(rg -c '^live collect-final$' "$work/requests.log")" = 1 ] -[ "$(rg -c '^gh attestation verify ' "$work/requests.log")" = 10 ] +[ "$(grep -c '^live collect$' "$work/requests.log")" = 2 ] +[ "$(grep -c '^live collect-final$' "$work/requests.log")" = 1 ] +[ "$(grep -c '^gh attestation verify ' "$work/requests.log")" = 10 ] WORK="$work/verify" bash "$guard" verify jq '.resources[0].instances[0].attributes.arn="different"' "$work/final-state.json" >"$work/changed-state.json" if bash "$guard" check-final-state "$work/changed-state.json" "$work/state.json" 2>/dev/null; then