File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,18 @@ jobs:
3939 - uses : actions/checkout@v4
4040 with :
4141 token : ${{ secrets.GH_TOKEN }}
42+ ref : main # Explicitly checkout main branch first
4243 - uses : pnpm/action-setup@v4
4344 - uses : actions/setup-node@v4
4445 with :
4546 node-version : 22
4647 cache : pnpm
4748 - run : pnpm install --frozen-lockfile
4849
49- - name : Checkout
50- run : git fetch origin ${{ env.BRANCH }} && git checkout ${{ env.BRANCH }} || git checkout -b ${{ env.BRANCH }}
50+ - name : Create or reset branch from main
51+ run : |
52+ git fetch origin
53+ git checkout -B ${{ env.BRANCH }} # Force create/reset branch based on current main
5154
5255 - name : Sync
5356 run : cd apps/svelte.dev && pnpm sync-docs --owner="${{ inputs.owner }}" -p "${{ inputs.repo }}#${{ inputs.branch }}"
5962
6063 - name : Push
6164 id : push
62- run : git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }}
65+ run : git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }} --force
6366
6467 - name : Request preview comment
6568 uses : peter-evans/repository-dispatch@v3
You can’t perform that action at this time.
0 commit comments