Skip to content

Commit

Permalink
Trim quotes on branch names
Browse files Browse the repository at this point in the history
  • Loading branch information
colbynh committed Jan 26, 2022
1 parent 5e942cd commit 6925fe2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions delete-old-branches
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 6925fe2

Please sign in to comment.