diff --git a/.github/workflows/sync.yaml b/.github/workflows/sync.yaml index d22bff603..4ba68e2a1 100644 --- a/.github/workflows/sync.yaml +++ b/.github/workflows/sync.yaml @@ -8,6 +8,7 @@ on: permissions: contents: write + pull-requests: write jobs: sync-to-dev: @@ -16,20 +17,33 @@ jobs: (github.ref == 'refs/heads/main' && contains(github.event.head_commit.message || '', 'release(desktop):')) || (github.ref == 'refs/heads/mobile-main' && contains(github.event.head_commit.message || '', 'release(mobile):')) steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - - name: Set up Git - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "github-actions[bot]@users.noreply.github.com" - - - name: Merge source branch into dev + - name: Create or update sync pull request + env: + GH_TOKEN: ${{ github.token }} run: | source_branch="${GITHUB_REF_NAME}" - git fetch origin main mobile-main dev - git checkout dev - git merge --no-ff "origin/${source_branch}" -m "chore(sync): merge ${source_branch} into dev" - git push origin dev + title="chore(sync): merge ${source_branch} into dev" + body=$(cat <