From a778ff84d9d2dbb760f68f67cbe9c82a469bbd4b Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Mon, 24 Nov 2025 09:30:03 +0100 Subject: [PATCH] fix: propagate errors from parallel downloads in res-update-game workflow (#14794) * Initial plan * fix: properly handle errors in parallel downloads for stages.json Co-authored-by: AnnAngela <9762652+AnnAngela@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: AnnAngela <9762652+AnnAngela@users.noreply.github.com> --- .github/workflows/res-update-game.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/res-update-game.yml b/.github/workflows/res-update-game.yml index a581419556..0af75d7b5a 100644 --- a/.github/workflows/res-update-game.yml +++ b/.github/workflows/res-update-game.yml @@ -107,6 +107,7 @@ jobs: parameters=("CN" "US" "JP" "KR") + pids=() for param in "${parameters[@]}"; do { if curl -f -s -o "stages_${param}.json" "${baseUrl}${param}"; then @@ -116,8 +117,20 @@ jobs: exit 1 fi } & + pids+=($!) done - wait + + failed=0 + for pid in "${pids[@]}"; do + if ! wait "$pid"; then + failed=1 + fi + done + + if [ $failed -ne 0 ]; then + echo "One or more downloads failed" >&2 + exit 1 + fi - name: Upload Taiwan resources uses: actions/upload-artifact@v5