Skip to content

Commit

Permalink
refactor(ci): use gh pr list instead of view
Browse files Browse the repository at this point in the history
  • Loading branch information
themightychris committed Nov 22, 2023
1 parent b2fd634 commit 3ba1cfa
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions github-workflows/k8s-prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,13 @@ jobs:
echo
echo "Looking for existing open PR for branch ${BRANCH_RELEASE}..."
_existing_pr_number=$(
gh pr view "${BRANCH_RELEASE}" \
--json number,state \
--template '{{.number}}{{"\t"}}{{.state}}' \
| grep OPEN \
| awk '{print $1}'
gh pr list \
--head "${BRANCH_RELEASE}" \
--base "${BRANCH_DEPLOY}" \
--state open \
--limit 1 \
--json number \
--jq '.[0].number'
)
if [ -n "${_existing_pr_number}" ]; then
Expand Down

0 comments on commit 3ba1cfa

Please sign in to comment.