Skip to content

Commit 5be2f02

Browse files
committed
update
1 parent 2062915 commit 5be2f02

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,19 @@ jobs:
4545
outputs:
4646
PR_OPEN: ${{ steps.check_pr.outputs.pr_open }}
4747
steps:
48-
- name: Checkout
49-
uses: actions/checkout@v2
50-
5148
- name: Check if PR is open
5249
id: check_pr
5350
run: |
5451
set -euo pipefail
55-
pr_open=$(gh pr view --json state | jq -r '.state' != "OPEN")
56-
if [[ "$pr_open" == "true" ]]; then
57-
echo "PR is closed. Exiting."
58-
exit 0
52+
pr_open=true
53+
if [[ "$(gh pr view $PR_BRANCH --json state | jq -r '.state')" != "true" ]]; then
54+
echo "PR doesn't exist or is closed."
55+
pr_open=false
5956
fi
6057
echo "pr_open=$pr_open" >> $GITHUB_OUTPUT
6158
env:
6259
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
PR_BRANCH: ${{ github.ref }}
6361

6462
get_info:
6563
needs: check_pr

0 commit comments

Comments
 (0)