From 39282fb4c18c6c9d84079bf642a6a8a7842c565b Mon Sep 17 00:00:00 2001 From: Kaan Kacar Date: Wed, 20 May 2026 21:03:09 +0300 Subject: [PATCH] Fix preview basePath to match pr-preview-action deploy path `rossjrw/pr-preview-action` deploys previews to `/pr-` by default, but the workflow was building Next.js with `NEXT_BASE_PATH=/pr/` (no `pr-` prefix). Asset URLs baked into the HTML were therefore looking for `/pr/22/_next/...` while the files were actually served at `/pr/pr-22/_next/...`, returning 404 and producing an unstyled preview. Add the `pr-` prefix so the basePath matches where the action publishes. Closes #23. --- .github/workflows/preview-pr.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/preview-pr.yml b/.github/workflows/preview-pr.yml index 15b6666..aa429b0 100644 --- a/.github/workflows/preview-pr.yml +++ b/.github/workflows/preview-pr.yml @@ -69,10 +69,13 @@ jobs: uses: actions/checkout@v4 # Preview-scoped basePath. The site is served from skills.stellar.org - # at the apex, so previews live at `skills.stellar.org/pr//`. + # at the apex, so previews live at `skills.stellar.org/pr/pr-/`. + # `rossjrw/pr-preview-action` deploys under `/pr-` + # by default, so the basePath must include the `pr-` prefix on the + # number to match — otherwise asset URLs baked into the HTML 404. - name: Resolve NEXT_BASE_PATH if: github.event.action != 'closed' - run: echo "NEXT_BASE_PATH=/pr/${{ github.event.number }}" >> "$GITHUB_ENV" + run: echo "NEXT_BASE_PATH=/pr/pr-${{ github.event.number }}" >> "$GITHUB_ENV" - if: github.event.action != 'closed' uses: pnpm/action-setup@v4