From eaa95d08d02a1582f728ffc8492e8ed9386afe12 Mon Sep 17 00:00:00 2001 From: Pablo2048 Date: Sat, 12 Oct 2024 15:15:43 +0200 Subject: [PATCH] New way to sync --- .github/workflows/sync-main-to-dev.yml | 29 +++++++++----------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/sync-main-to-dev.yml b/.github/workflows/sync-main-to-dev.yml index 3878783..c764579 100644 --- a/.github/workflows/sync-main-to-dev.yml +++ b/.github/workflows/sync-main-to-dev.yml @@ -1,29 +1,20 @@ -name: Sync main to development +name: Update Development Branch After PR Merge on: - push: - branches: - - main + pull_request: + types: [closed] jobs: - sync: + update-dev: + if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v2 - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + - name: Set executable permissions + run: chmod +x ./update_dev.sh - - name: Fetch all branches - run: git fetch --all - - - name: Merge main into development - run: | - git checkout development - git merge main - - - name: Push changes to development - run: git push origin development + - name: Run update_dev.sh script + run: ./update_dev.sh