From aeb9e85ab62f6f0ca73fe95cf73802902a6cc8f2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 18:08:26 +0800 Subject: [PATCH] fix(ci): support local PR batch rehearsal --- scripts/deploy-test-runtime.sh | 2 +- scripts/prepare-pr-batch.sh | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/deploy-test-runtime.sh b/scripts/deploy-test-runtime.sh index 3fb9950b..47a2f3cc 100755 --- a/scripts/deploy-test-runtime.sh +++ b/scripts/deploy-test-runtime.sh @@ -117,7 +117,7 @@ deploy_tag="$1" immutable_tag="$2" merged_sha="$3" pr_csv="$4" -run_url="$5" +run_url="${5:-}" sudo /usr/local/bin/skillhub-test-deploy \ --deploy-tag "${deploy_tag}" \ diff --git a/scripts/prepare-pr-batch.sh b/scripts/prepare-pr-batch.sh index 31e9e1cd..0b5f56a3 100755 --- a/scripts/prepare-pr-batch.sh +++ b/scripts/prepare-pr-batch.sh @@ -56,7 +56,6 @@ fi normalized_input="$(printf '%s' "${pr_input}" | tr ',;\r\n\t' ' ')" declare -a pr_numbers=() -declare -A seen_prs=() for token in ${normalized_input}; do if [[ ! "${token}" =~ ^[0-9]+$ ]]; then @@ -64,11 +63,20 @@ for token in ${normalized_input}; do exit 1 fi - if [[ -n "${seen_prs[${token}]:-}" ]]; then + already_seen=false + if [[ "${#pr_numbers[@]}" -gt 0 ]]; then + for existing in "${pr_numbers[@]}"; do + if [[ "${existing}" == "${token}" ]]; then + already_seen=true + break + fi + done + fi + + if [[ "${already_seen}" == "true" ]]; then continue fi - seen_prs["${token}"]=1 pr_numbers+=("${token}") done