File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,18 @@ jobs:
39
39
- uses : actions/checkout@v4
40
40
with :
41
41
token : ${{ secrets.GH_TOKEN }}
42
+ ref : main # Explicitly checkout main branch first
42
43
- uses : pnpm/action-setup@v4
43
44
- uses : actions/setup-node@v4
44
45
with :
45
46
node-version : 22
46
47
cache : pnpm
47
48
- run : pnpm install --frozen-lockfile
48
49
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
51
54
52
55
- name : Sync
53
56
run : cd apps/svelte.dev && pnpm sync-docs --owner="${{ inputs.owner }}" -p "${{ inputs.repo }}#${{ inputs.branch }}"
59
62
60
63
- name : Push
61
64
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
63
66
64
67
- name : Request preview comment
65
68
uses : peter-evans/repository-dispatch@v3
You can’t perform that action at this time.
0 commit comments