From f5afd5a7f783d97fbad95fd40a7697b2acb0ef77 Mon Sep 17 00:00:00 2001 From: Sergei Petrosian Date: Fri, 2 Aug 2024 12:55:32 +0200 Subject: [PATCH] Fix jq's select --- .github/workflows/tft_citest_bad.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tft_citest_bad.yml b/.github/workflows/tft_citest_bad.yml index 5cee060..39c4457 100644 --- a/.github/workflows/tft_citest_bad.yml +++ b/.github/workflows/tft_citest_bad.yml @@ -25,10 +25,10 @@ jobs: PR_TITLE: ${{ github.event.issue.title }} run: | PENDING_RUN=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \ - | jq -r '[.workflow_runs[] | select(.display_title="$PR_TITLE") | select(.status == "pending" or .status == "queued" or .status == "in_progress") | .id][0]') + | jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\") | select(.status == "pending" or .status == "queued" or .status == "in_progress") | .id][0]") if [ "$PENDING_RUN" = "null" ]; then # if pending run don't exist, take the last run with failure state RUN_ID=$(gh api "repos/$REPO/actions/workflows/tft.yml/runs?event=issue_comment" \ - | jq -r '[.workflow_runs[] | select( .conclusion == "failure" ) | select ( .display_title="$PR_TITLE" ) | .id][0]') + | jq -r "[.workflow_runs[] | select( .display_title == \"$PR_TITLE\" ) | select( .conclusion == "failure" ) | .id][0]") echo "Re-running workflow $RUN_ID" gh api --method POST repos/$REPO/actions/runs/$RUN_ID/rerun-failed-jobs else