From c41126dbbb9b8b865ce10764bd6417a6e3320720 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 27 Apr 2026 15:51:03 +0100 Subject: [PATCH] ci: capture dispatched full validation runs --- .github/workflows/full-release-validation.yml | 64 ++++++++++++------- 1 file changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/workflows/full-release-validation.yml b/.github/workflows/full-release-validation.yml index 06388eda258..0ff484c4fa5 100644 --- a/.github/workflows/full-release-validation.yml +++ b/.github/workflows/full-release-validation.yml @@ -123,21 +123,29 @@ jobs: local workflow="$1" shift - local before_json run_id status conclusion url + local before_json dispatch_output run_id status conclusion url before_json="$(gh run list --workflow "$workflow" --event workflow_dispatch --limit 100 --json databaseId --jq '[.[].databaseId]')" - gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" + dispatch_output="$(gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" 2>&1)" + printf '%s\n' "$dispatch_output" + run_id="$( + printf '%s\n' "$dispatch_output" | + sed -nE 's#.*actions/runs/([0-9]+).*#\1#p' | + tail -n 1 + )" - for _ in $(seq 1 60); do - run_id="$( - BEFORE_IDS="$before_json" gh run list --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \ - --jq 'map(select(.databaseId as $id | (env.BEFORE_IDS | fromjson | index($id) | not))) | sort_by(.createdAt) | reverse | .[0].databaseId // empty' - )" - if [[ -n "$run_id" ]]; then - break - fi - sleep 5 - done + if [[ -z "$run_id" ]]; then + for _ in $(seq 1 60); do + run_id="$( + BEFORE_IDS="$before_json" gh run list --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \ + --jq 'map(select(.databaseId as $id | (env.BEFORE_IDS | fromjson | index($id) | not))) | sort_by(.createdAt) | reverse | .[0].databaseId // empty' + )" + if [[ -n "$run_id" ]]; then + break + fi + sleep 5 + done + fi if [[ -z "${run_id:-}" ]]; then echo "Could not find dispatched run for ${workflow}." >&2 @@ -200,21 +208,29 @@ jobs: local workflow="$1" shift - local before_json run_id status conclusion url + local before_json dispatch_output run_id status conclusion url before_json="$(gh run list --workflow "$workflow" --event workflow_dispatch --limit 100 --json databaseId --jq '[.[].databaseId]')" - gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" + dispatch_output="$(gh workflow run "$workflow" --ref "$CHILD_WORKFLOW_REF" "$@" 2>&1)" + printf '%s\n' "$dispatch_output" + run_id="$( + printf '%s\n' "$dispatch_output" | + sed -nE 's#.*actions/runs/([0-9]+).*#\1#p' | + tail -n 1 + )" - for _ in $(seq 1 60); do - run_id="$( - BEFORE_IDS="$before_json" gh run list --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \ - --jq 'map(select(.databaseId as $id | (env.BEFORE_IDS | fromjson | index($id) | not))) | sort_by(.createdAt) | reverse | .[0].databaseId // empty' - )" - if [[ -n "$run_id" ]]; then - break - fi - sleep 5 - done + if [[ -z "$run_id" ]]; then + for _ in $(seq 1 60); do + run_id="$( + BEFORE_IDS="$before_json" gh run list --workflow "$workflow" --event workflow_dispatch --limit 50 --json databaseId,createdAt \ + --jq 'map(select(.databaseId as $id | (env.BEFORE_IDS | fromjson | index($id) | not))) | sort_by(.createdAt) | reverse | .[0].databaseId // empty' + )" + if [[ -n "$run_id" ]]; then + break + fi + sleep 5 + done + fi if [[ -z "${run_id:-}" ]]; then echo "Could not find dispatched run for ${workflow}." >&2