Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/docs-preview-create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,18 @@ jobs:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: main # Explicitly checkout main branch first
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile

- name: Checkout
run: git fetch origin ${{ env.BRANCH }} && git checkout ${{ env.BRANCH }} || git checkout -b ${{ env.BRANCH }}
- name: Create or reset branch from main
run: |
git fetch origin
git checkout -B ${{ env.BRANCH }} # Force create/reset branch based on current main

- name: Sync
run: cd apps/svelte.dev && pnpm sync-docs --owner="${{ inputs.owner }}" -p "${{ inputs.repo }}#${{ inputs.branch }}"
Expand All @@ -59,7 +62,7 @@ jobs:

- name: Push
id: push
run: git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }}
run: git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }} --force

- name: Request preview comment
uses: peter-evans/repository-dispatch@v3
Expand Down