From 8981c50269b16f252800cf829d83bf31c24c8476 Mon Sep 17 00:00:00 2001 From: Edaena Salinas Date: Wed, 15 Apr 2020 00:01:44 -0700 Subject: [PATCH] Update functions --- tests/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/functions.sh b/tests/functions.sh index 618d3c5a..a0b65616 100644 --- a/tests/functions.sh +++ b/tests/functions.sh @@ -537,10 +537,10 @@ function approve_pull_request () { exit 1 fi fi - real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[].title | startswith($pr_title)) | .[].title' | head -n 1) + real_title=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .title' | head -n 1) pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[0].title | startswith($pr_title)) | .[0].pullRequestId') if [ "$pull_request_id" == "" ]; then - pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" 'select(.[].title | startswith($pr_title)) | .[0].pullRequestId') + pull_request_id=$(echo $all_prs | jq -r --arg pr_title "$pr_title" '.[] | select(.title | startswith($pr_title)) | .pullRequestId' | head -n 1) fi echo "Found pull request starting with phrase '$pr_title'" echo "Pull request id $pull_request_id is '$real_title'"