diff --git a/.github/workflows/gitflow-sync-develop.yml b/.github/workflows/gitflow-sync-develop.yml index 54fe0e5234b5..a63ab17b591e 100644 --- a/.github/workflows/gitflow-sync-develop.yml +++ b/.github/workflows/gitflow-sync-develop.yml @@ -11,7 +11,8 @@ on: workflow_dispatch: env: - DEV_BRANCH: develop + SOURCE_BRANCH: master + TARGET_BRANCH: develop jobs: main: @@ -29,9 +30,10 @@ jobs: id: open-pr uses: repo-sync/pull-request@v2 with: - destination_branch: ${{ env.DEV_BRANCH }} - pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.DEV_BRANCH }}' - pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.DEV_BRANCH }}' + source_branch: ${{ env.SOURCE_BRANCH }} + destination_branch: ${{ env.TARGET_BRANCH }} + pr_title: '[Gitflow] Merge ${{ env.SOURCE_BRANCH }} into ${{ env.TARGET_BRANCH }}' + pr_body: 'Merge ${{ env.SOURCE_BRANCH }} branch into ${{ env.TARGET_BRANCH }}' pr_label: 'Dev: Gitflow' # https://github.com/marketplace/actions/enable-pull-request-automerge @@ -45,6 +47,7 @@ jobs: # https://github.com/marketplace/actions/auto-approve - name: Auto approve PR uses: hmarr/auto-approve-action@v3 + if: steps.open-pr.outputs.pr_number != '' with: pull-request-number: ${{ steps.open-pr.outputs.pr_number }} review-message: 'Auto approved automated PR' diff --git a/.github/workflows/gitflow-sync-master.yml b/.github/workflows/gitflow-sync-master.yml index 9dbd6ca050e5..8c54a8b4e183 100644 --- a/.github/workflows/gitflow-sync-master.yml +++ b/.github/workflows/gitflow-sync-master.yml @@ -13,7 +13,8 @@ on: workflow_dispatch: env: - MAIN_BRANCH: master + SOURCE_BRANCH: develop + TARGET_BRANCH: master jobs: main: @@ -31,9 +32,10 @@ jobs: id: open-pr uses: repo-sync/pull-request@v2 with: - destination_branch: ${{ env.MAIN_BRANCH }} - pr_title: '[Gitflow] Merge ${{ github.ref_name }} into ${{ env.MAIN_BRANCH }}' - pr_body: 'Merge ${{ github.ref_name }} branch into ${{ env.MAIN_BRANCH }}' + source_branch: ${{ env.SOURCE_BRANCH }} + destination_branch: ${{ env.TARGET_BRANCH }} + pr_title: '[Gitflow] Merge ${{ env.SOURCE_BRANCH }} into ${{ env.TARGET_BRANCH }}' + pr_body: 'Merge ${{ env.SOURCE_BRANCH }} branch into ${{ env.TARGET_BRANCH }}' pr_label: 'Dev: Gitflow' # https://github.com/marketplace/actions/enable-pull-request-automerge @@ -47,6 +49,7 @@ jobs: # https://github.com/marketplace/actions/auto-approve - name: Auto approve PR uses: hmarr/auto-approve-action@v3 + if: steps.open-pr.outputs.pr_number != '' with: pull-request-number: ${{ steps.open-pr.outputs.pr_number }} review-message: 'Auto approved automated PR'