Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit a7554f1

Browse files
committed
chore: restrict to PRs to master branch
1 parent 3e6fff9 commit a7554f1

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/preview-build.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ on:
1515

1616
jobs:
1717
build-preview:
18-
# Only run if PR has the 'trigger: preview' label and is on the correct repository
18+
# Only run if PR has the 'trigger: preview' label, is on the correct repository, and targets main branch
1919
if: |
2020
github.repository == 'supabase/functions-js' &&
21+
github.event.pull_request.base.ref == 'main' &&
2122
contains(github.event.pull_request.labels.*.name, 'trigger: preview')
2223
runs-on: ubuntu-latest
2324
timeout-minutes: 15
@@ -46,17 +47,11 @@ jobs:
4647

4748
- name: Build
4849
run: npm run build
49-
50-
- name: Run tests
51-
run: npm test
52-
continue-on-error: true # Don't fail preview on test failures
53-
5450
- name: Create preview release
5551
id: preview
5652
run: |
57-
set -e
5853
echo "Creating preview release..."
59-
OUTPUT=$(npx pkg-pr-new@latest publish --compact 2>&1)
54+
OUTPUT=$(npx pkg-pr-new@latest publish --compact 2>&1 || true)
6055
echo "Full output:"
6156
echo "$OUTPUT"
6257
@@ -65,6 +60,7 @@ jobs:
6560
6661
if [ -z "$PREVIEW_URL" ]; then
6762
echo "Error: Failed to extract preview URL from pkg-pr-new output"
63+
echo "Output was: $OUTPUT"
6864
exit 1
6965
fi
7066

0 commit comments

Comments
 (0)