From c0d4007efff85f511fce1696772dd2226702c816 Mon Sep 17 00:00:00 2001 From: Salah Al Saleh Date: Mon, 26 Feb 2024 22:40:19 +0000 Subject: [PATCH] fix syntax --- .github/workflows/automated-prs-manager.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/automated-prs-manager.yaml b/.github/workflows/automated-prs-manager.yaml index d745d5218..dcba290d3 100644 --- a/.github/workflows/automated-prs-manager.yaml +++ b/.github/workflows/automated-prs-manager.yaml @@ -70,7 +70,7 @@ jobs: # If all checks passed, approve and merge. if gh run view "$run_id" --json jobs -q '.jobs[] | select(.name == "validate-success") | .conclusion' | grep -q "success"; then - if gh pr checks "${{ matrix.pr.url }}" ; then + if gh pr checks "${{ matrix.pr.url }}"; then echo "All tests passed. Approving and merging." echo -e "LGTM :thumbsup: \n\nThis PR was automatically approved and merged by the [automated-prs-manager](https://github.com/replicatedhq/troubleshoot/blob/main/.github/workflows/automated-prs-manager.yaml) GitHub action" > body.txt gh pr review --approve "${{ matrix.pr.url }}" --body-file body.txt @@ -86,7 +86,7 @@ jobs: # If more than half of the jobs are successful, re-run the failed jobs. num_of_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[].name ' | wc -l) - num_of_successful_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[] | select (.conclusion == "success")) |.name ' | wc -l) + num_of_successful_jobs=$(gh run view "$run_id" --json jobs -q '.jobs[] | select(.conclusion == "success") | .name' | wc -l) if [ "$num_of_successful_jobs" -gt $((num_of_jobs / 2)) ]; then echo "More than half of the jobs are successful. Re-running failed jobs."