Skip to content

Commit 2f1b302

Browse files
Merge pull request #355 from Rajesh-Nagarajan-11/PR-PREVIEW-FIX]
Enable deploy previews for pull requests
2 parents cb2a355 + bb9502d commit 2f1b302

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/static.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
# Simple workflow for deploying static content to GitHub Pages
2-
name: Deploy static content to Pages
2+
name: preview-deploy
33

44
on:
5-
pull_request:
6-
branches: [ "master" ]
75
pull_request_target:
86
branches: [ "master" ]
7+
types: [opened, synchronize, reopened]
98

109
workflow_dispatch:
1110

@@ -31,7 +30,8 @@ jobs:
3130
- name: Checkout
3231
uses: actions/checkout@v4
3332
with:
34-
ref: ${{ github.event.pull_request.base.ref }}
33+
ref: ${{ github.event.pull_request.head.sha }}
34+
submodules: recursive
3535
- name: Setup Pages
3636
uses: actions/configure-pages@v5
3737
- name: Setup Hugo (Extended)
@@ -54,7 +54,7 @@ jobs:
5454
uses: actions/deploy-pages@v4
5555

5656
- name: Comment Preview URL on PR
57-
if: github.event_name == 'pull_request'
57+
if: github.event_name == 'pull_request_target'
5858
uses: marocchino/sticky-pull-request-comment@v2
5959
with:
6060
message: |

0 commit comments

Comments
 (0)