diff --git a/.github/workflows/sync-dev-after-release.yml b/.github/workflows/sync-dev-after-release.yml new file mode 100644 index 00000000..1e1fdbc2 --- /dev/null +++ b/.github/workflows/sync-dev-after-release.yml @@ -0,0 +1,35 @@ +name: Sync Dev After Main Release + +on: + workflow_run: + workflows: ["Release"] + types: [completed] + branches: [main] + +jobs: + sync-dev: + # Only run if Release workflow succeeded on main branch + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }} + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.PAT_TOKEN }} + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Sync dev with main + run: | + git fetch origin main dev + git checkout dev + git merge origin/main --no-edit -m "chore(sync): merge main into dev after release [skip ci]" + git push origin dev