1 name: Sync Docs Staging Branch
2
3 on:
4 push:
5 branches:
6 - develop
7
8 concurrency:
9 group: docs-release-staging
10 cancel-in-progress: false
11
12 jobs:
13 sync:
14 runs-on: ubuntu-latest
15 permissions:
16 contents: write
17 steps:
18 - name: Generate GitHub App token
19 id: app-token
20 uses: actions/create-github-app-token@v1
21 with:
22 app-id: ${{ secrets.MEDUSA_APP_ID }}
23 private-key: ${{ secrets.MEDUSA_APP_PRIVATE_KEY }}
24
25 - name: Checkout repository
26 uses: actions/checkout@v4
27 with:
28 fetch-depth: 0
29 token: ${{ steps.app-token.outputs.token }}
30
31 - name: Configure git
32 run: |
33 git config user.name "github-actions[bot]"
34 git config user.email "github-actions[bot]@users.noreply.github.com"
35
36 - name: Sync docs/release-docs-staging with develop
37 run: |
38 git fetch origin
39 if git ls-remote --exit-code origin docs/release-docs-staging > /dev/null 2>&1; then
40 git checkout docs/release-docs-staging
41 git merge -X theirs origin/develop -m "chore: sync docs/release-docs-staging with develop"
42 git push origin docs/release-docs-staging
43 echo "Synced docs/release-docs-staging with develop"
44 else
45 echo "Branch docs/release-docs-staging does not exist yet — nothing to sync"
46 fi