Skip to content

Commit c1e0a11

Browse files
committed
Use "pr list" instead
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent d87fc2b commit c1e0a11

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: |
5959
set -euo pipefail
6060
pr_open=true
61-
if [[ "$(gh pr status --json state --repo=coder/coder --jq '.createdBy[0].state')" != "OPEN" ]]; then
61+
if [[ "$(gh pr list --repo=coder/coder -H $(git rev-parse --abbrev-ref HEAD) --json state --jq '.[].state')" != "OPEN" ]]; then
6262
>&2 echo "PR doesn't exist or is closed."
6363
pr_open=false
6464
fi

scripts/deploy-pr.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ fi
7171
gh_auth
7272

7373
# get branch name and pr number
74-
info=$(gh pr status --repo=coder/coder --json headRefName,number --jq '.createdBy[0]')
75-
branchName=$(echo "${info}" | jq -r .headRefName)
76-
prNumber=$(echo "${info}" | jq -r .number)
74+
branchName=$(git rev-parse --abbrev-ref HEAD)
75+
prNumber=$(gh pr list --repo=coder/coder -H ${branchName} --json number --jq '.[].number')
7776

7877
if [[ "$dryRun" = true ]]; then
7978
echo "dry run"

0 commit comments

Comments
 (0)