File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 58
58
run : |
59
59
set -euo pipefail
60
60
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
62
62
>&2 echo "PR doesn't exist or is closed."
63
63
pr_open=false
64
64
fi
Original file line number Diff line number Diff line change 71
71
gh_auth
72
72
73
73
# 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' )
77
76
78
77
if [[ " $dryRun " = true ]]; then
79
78
echo " dry run"
You can’t perform that action at this time.
0 commit comments