Skip to content

Commit 01c7485

Browse files
committed
refactor
1 parent 505fd45 commit 01c7485

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

scripts/deploy-pr.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44
set -euox pipefail
55

66
branchName=$(gh pr view --json headRefName | jq -r .headRefName)
7+
78
if [[ "$branchName" == "main" ]]; then
8-
# get commit sha --short
9-
commitSha=$(git rev-parse --short HEAD)
10-
gh workflow run pr-deploy.yaml /
11-
--ref $branchName /
12-
-f pr_number=${commitSha}
9+
gh workflow run pr-deploy.yaml --ref $branchName -f pr_number=$(git rev-parse --short HEAD)
1310
else
14-
prNumber=$(gh pr view --json number | jq -r .number)
15-
gh workflow run pr-deploy.yaml /
16-
--ref $branchName /
17-
-f pr_number=${prNumber}
11+
gh workflow run pr-deploy.yaml --ref $branchName -f pr_number=$(gh pr view --json number | jq -r .number)
1812
fi

0 commit comments

Comments
 (0)