Skip to content

Commit 2361e3c

Browse files
authored
ci: fix preview fail on PR closed (#33)
* ci: fix preview fail on PR closed * skipping steps
1 parent 6b8c808 commit 2361e3c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/preview.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: actions/checkout@v4
2626

2727
- name: Checkout PR head
28-
if: ${{ startsWith(github.event_name, 'pull_request') }}
28+
if: ${{ startsWith(github.event_name, 'pull_request') && github.event.action != 'closed' }}
2929
uses: actions/checkout@v4
3030
with:
3131
ref: refs/pull/${{ github.event.pull_request.number }}/merge
@@ -35,28 +35,32 @@ jobs:
3535
uses: actions/setup-node@v4
3636
if: ${{ github.event.action != 'closed' }} # Skipping these steps if the PR has been closed
3737
with:
38-
node-version-file: "package.json"
39-
38+
node-version-file: 'package.json'
39+
4040
- uses: pnpm/action-setup@v4
41+
if: ${{ github.event.action != 'closed' }}
4142
with:
4243
version: 10
4344
run_install: false
4445

4546
- name: Get pnpm store directory
4647
id: pnpm-cache
48+
if: ${{ github.event.action != 'closed' }}
4749
shell: bash
4850
run: |
4951
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
5052
5153
- uses: actions/cache@v4
5254
name: Setup pnpm cache
55+
if: ${{ github.event.action != 'closed' }}
5356
with:
5457
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
5558
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
5659
restore-keys: |
5760
${{ runner.os }}-pnpm-store-V
5861
5962
- name: Install dependencies
63+
if: ${{ github.event.action != 'closed' }}
6064
run: pnpm install
6165

6266
# This will calculate the base URL for the website, based on the event that triggered the workflow.

0 commit comments

Comments
 (0)