diff --git a/scripts/brew_formula_pr.sh b/scripts/brew_formula_pr.sh index 6f0e0a65e484..528cd68f67bd 100755 --- a/scripts/brew_formula_pr.sh +++ b/scripts/brew_formula_pr.sh @@ -75,8 +75,8 @@ ssh-agent bash -c 'ssh-add /secrets/ssh-secrets/ssh-privatekey; ssh -o StrictHos echo "Added ssh private key\n" -PR_EXISTS=$(gh pr list | grep -c "${PR_BRANCH}" || true) -if [ $PR_EXISTS -eq 0 ]; then +PR_EXISTS=$(GH_PAGER="" gh pr list --json number -H "${PR_BRANCH}") +if [ "$PR_EXISTS" = "[]" ]; then gh pr create --title "$PR_TITLE" --body "$PR_BODY" --repo "${UPSTREAM_ORG}/${REPO}" fi diff --git a/scripts/create_pr.sh b/scripts/create_pr.sh index 19a77b3059a3..072319f04a32 100755 --- a/scripts/create_pr.sh +++ b/scripts/create_pr.sh @@ -56,7 +56,7 @@ ssh-agent bash -c 'ssh-add /secrets/ssh-secrets/ssh-privatekey; ssh -o StrictHos gh auth login --with-token < /secrets/github-secrets/token -PR_EXISTS=$(gh pr list | grep -c "${PR_BRANCH}" || true) -if [ $PR_EXISTS -eq 0 ]; then +PR_EXISTS=$(GH_PAGER="" gh pr list --json number -H "${PR_BRANCH}") +if [ "$PR_EXISTS" = "[]" ]; then gh pr create --title "$PR_TITLE" --body "$PR_BODY" fi diff --git a/scripts/golden_create_pr.sh b/scripts/golden_create_pr.sh index 4acbfb70f123..2164c826df05 100755 --- a/scripts/golden_create_pr.sh +++ b/scripts/golden_create_pr.sh @@ -56,7 +56,7 @@ ssh-agent bash -c 'ssh-add /secrets/ssh-secrets/ssh-privatekey; ssh -o StrictHos gh auth login --with-token < /secrets/github-secrets/token -PR_EXISTS=$(gh pr list | grep -c "${PR_BRANCH}" || true) -if [ $PR_EXISTS -eq 0 ]; then +PR_EXISTS=$(GH_PAGER="" gh pr list --json number -H "${PR_BRANCH}") +if [ "$PR_EXISTS" = "[]" ]; then gh pr create --title "$PR_TITLE" --body "$PR_BODY" fi