Skip to content

Commit 2303f8b

Browse files
committed
Fix logic for setting DEPLOY variable
1 parent 0c71cf0 commit 2303f8b

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

.github/workflows/Deploy.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ jobs:
2323
- name: Set options
2424
id: set-options
2525
run: |
26-
# Deploy only if the PR was opened on the same repository
27-
if [[ "${{ github.repository }}" == "${{ github.event.pull_request.head.repo.full_name }}" ]]; then
28-
DEPLOY="true"
29-
else
30-
DEPLOY="false"
31-
fi
26+
# By default always deploy
27+
DEPLOY="true"
3228
# Create previews only for pull requests
3329
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
3430
PREVIEW="previews/PR${PRNUM}"
31+
# For pull requests, actually deploy only if the PR was opened on the same
32+
# repository.
33+
if [[ "${{ github.repository }}" != "${{ github.event.pull_request.head.repo.full_name }}" ]]; then
34+
DEPLOY="false"
35+
fi
3536
else
3637
PREVIEW=""
3738
fi
@@ -43,7 +44,7 @@ jobs:
4344
PRNUM: ${{ github.event.number }}
4445

4546
deploy:
46-
name: "Deploy"
47+
name: "Build and Deploy"
4748
needs: options
4849
runs-on: ubuntu-latest
4950
permissions: write-all

0 commit comments

Comments
 (0)