From 6925fe23796cf942e75a1a018032e8f415944c6b Mon Sep 17 00:00:00 2001 From: colbynh Date: Wed, 26 Jan 2022 15:33:05 -0500 Subject: [PATCH] Trim quotes on branch names --- delete-old-branches | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/delete-old-branches b/delete-old-branches index ee69bfa..f962026 100755 --- a/delete-old-branches +++ b/delete-old-branches @@ -45,13 +45,14 @@ is_pr_open_on_branch() { local br=${1} open_prs_branches=$(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${GITHUB_TOKEN}" \ - "https://api.github.com/repos/${REPO}/pulls" | jq '.[].head.ref') + "https://api.github.com/repos/${REPO}/pulls" | jq '.[].head.ref' | tr -d '"') for pr_br in $open_prs_branches; do - if [[ "${pr_br}" == "${br}" ]]; then - return 0 - fi + if [[ "${pr_br}" == "${br}" ]]; then + return 0 + fi done + return 1 }