





















@@ -610,20 +610,64 @@ jobs:
610610 return 1
611611 fi
612612613- local status conclusion url attempt
614- status="$(gh run view "$run_id" --json status --jq '.status')"
615- conclusion="$(gh run view "$run_id" --json conclusion --jq '.conclusion')"
616- url="$(gh run view "$run_id" --json url --jq '.url')"
617- attempt="$(gh run view "$run_id" --json attempt --jq '.attempt')"
613+ local run_json status conclusion url attempt
614+ run_json="$(gh run view "$run_id" --json status,conclusion,url,attempt,jobs)"
615+ status="$(jq -r '.status' <<< "$run_json")"
616+ conclusion="$(jq -r '.conclusion' <<< "$run_json")"
617+ url="$(jq -r '.url' <<< "$run_json")"
618+ attempt="$(jq -r '.attempt' <<< "$run_json")"
618619 echo "${label}: ${status}/${conclusion} attempt ${attempt}: ${url}"
619620620621 if [[ "$status" != "completed" || "$conclusion" != "success" ]]; then
621622 echo "::error::${label} child run ended with ${status}/${conclusion}: ${url}"
622- gh run view "$run_id" --json jobs --jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, status, conclusion, url}' || true
623+ jq '.jobs[] | select(.conclusion != "success" and .conclusion != "skipped") | {name, status, conclusion, url}' <<< "$run_json" || true
623624 return 1
624625 fi
625626 }
626627628+ append_child_overview() {
629+ {
630+ echo
631+ echo "### Child workflow overview"
632+ echo
633+ echo "| Child | Result | Minutes | Run |"
634+ echo "| --- | --- | ---: | --- |"
635+ } >> "$GITHUB_STEP_SUMMARY"
636+637+ append_child_row() {
638+ local label="$1"
639+ local run_id="$2"
640+ local result="$3"
641+642+ if [[ -z "${run_id// }" ]]; then
643+ echo "| \`${label}\` | \`${result}\` | | skipped |" >> "$GITHUB_STEP_SUMMARY"
644+ return 0
645+ fi
646+647+ local run_json row
648+ run_json="$(gh run view "$run_id" --json status,conclusion,url,createdAt,updatedAt)"
649+ row="$(
650+ jq -r --arg label "$label" '
651+ def ts: fromdateiso8601;
652+ . as $run |
653+ ($run.createdAt // "") as $created |
654+ ($run.updatedAt // "") as $updated |
655+ (if ($created | length) > 0 and ($updated | length) > 0
656+ then (((($updated | ts) - ($created | ts)) / 60) * 10 | round / 10 | tostring)
657+ else ""
658+ end) as $minutes |
659+ "| `" + $label + "` | `" + ($run.status // "") + "/" + ($run.conclusion // "") + "` | " + $minutes + " | [run](" + ($run.url // "") + ") |"
660+ ' <<< "$run_json"
661+ )"
662+ echo "$row" >> "$GITHUB_STEP_SUMMARY"
663+ }
664+665+ append_child_row "normal_ci" "$NORMAL_CI_RUN_ID" "$NORMAL_CI_RESULT"
666+ append_child_row "plugin_prerelease" "$PLUGIN_PRERELEASE_RUN_ID" "$PLUGIN_PRERELEASE_RESULT"
667+ append_child_row "release_checks" "$RELEASE_CHECKS_RUN_ID" "$RELEASE_CHECKS_RESULT"
668+ append_child_row "npm_telegram" "$NPM_TELEGRAM_RUN_ID" "$NPM_TELEGRAM_RESULT"
669+ }
670+627671 summarize_child_timing() {
628672 local label="$1"
629673 local run_id="$2"
@@ -675,6 +719,8 @@ jobs:
675719676720 failed=0
677721722+ append_child_overview
723+678724 if [[ "$NORMAL_CI_RESULT" == "skipped" && -z "${NORMAL_CI_RUN_ID// }" ]]; then
679725 check_child "normal_ci" "" 0 || failed=1
680726 else
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。