Skip to content

Commit f3c20a2

Browse files
Implement conditional checkout for closed PRs
Add cleanup checkout step for closed pull requests Signed-off-by: Rajesh Nagarajan <139469505+Rajesh-Nagarajan-11@users.noreply.github.com>
1 parent 69c5f2e commit f3c20a2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/deploy-preview.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,20 @@ jobs:
4141
run: sudo snap install dart-sass
4242

4343
- name: Checkout
44+
if: github.event.action != 'closed'
4445
uses: actions/checkout@v6
4546
with:
4647
ref: ${{ github.event.pull_request.head.sha }}
4748
submodules: recursive
4849
fetch-depth: 0
4950

51+
- name: Checkout for cleanup
52+
if: github.event.action == 'closed'
53+
uses: actions/checkout@v6
54+
with:
55+
ref: gh-pages
56+
fetch-depth: 0
57+
5058
- name: Install Node.js dependencies
5159
if: github.event.action != 'closed'
5260
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"

0 commit comments

Comments
 (0)