Skip to content

Commit 54c6ac7

Browse files
committed
fix
1 parent c9ba19c commit 54c6ac7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/docs-preview-create.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
repository_dispatch:
55
types: [docs-preview-create]
66

7+
env:
8+
BRANCH: sync/${{ github.event.client_payload.package }}/${{ github.event.client_payload.owner }}/${{ github.event.client_payload.branch }}
9+
710
jobs:
811
Sync:
912
runs-on: ubuntu-latest
@@ -19,7 +22,7 @@ jobs:
1922
- run: pnpm install --frozen-lockfile
2023

2124
- name: Checkout
22-
run: git checkout -B sync/${{ github.event.client_payload.package }}/${{ github.event.client_payload.owner }}/${{ github.event.client_payload.branch }}
25+
run: git switch -c ${{ env.BRANCH }} || git switch ${{ env.BRANCH }}
2326

2427
- name: Sync
2528
run: cd apps/svelte.dev && pnpm sync-docs --owner="${{ github.event.client_payload.owner }}" -p "${{ github.event.client_payload.package }}#${{ github.event.client_payload.branch }}"
@@ -30,4 +33,4 @@ jobs:
3033
git config --global user.email "github-actions[bot]@users.noreply.github.com"
3134
3235
- name: Push
33-
run: git add -A && git commit -m "sync docs" && git push -u origin sync/${{ github.event.client_payload.package }}/${{ github.event.client_payload.owner }}/${{ github.event.client_payload.branch }}
36+
run: git add -A && git commit -m "sync docs" && git push -u origin ${{ env.BRANCH }}

0 commit comments

Comments
 (0)