Skip to content

Commit fb5f588

Browse files
committed
Modify preview deployment script to work with forks by specifying the coder/coder repo
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 9eb797e commit fb5f588

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ jobs:
4747
run: |
4848
set -euo pipefail
4949
pr_open=true
50-
if [[ "$(gh pr view --json state | jq -r '.state')" != "OPEN" ]]; then
51-
echo "PR doesn't exist or is closed."
50+
if [[ "$(gh pr status --json state --repo=coder/coder --jq '.createdBy[0].state')" != "OPEN" ]]; then
51+
echo >&2 "PR doesn't exist or is closed."
5252
pr_open=false
5353
fi
5454
echo "pr_open=$pr_open" >> $GITHUB_OUTPUT

scripts/deploy-pr.sh

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

7373
# get branch name and pr number
74-
branchName=$(gh pr view --json headRefName | jq -r .headRefName)
75-
prNumber=$(gh pr view --json number | jq -r .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)
7677

7778
if [[ "$dryRun" = true ]]; then
7879
echo "dry run"

0 commit comments

Comments
 (0)