1

I'm setting up Github actions for a few of my projects. The flow I'd like to achieve is:

  1. A developer opens a new pull request
  2. The branch is automatically merged with the main branch

My question is, is it possible to achieve this kind of workflow? If not, what are the other possible alternatives?

eyah
  • 111
  • 1
  • 8

1 Answers1

0

You could use the GitHub Action "Merge branch", for instance for any feature/xxx branch pushed (you can change the naming convention as you want).

name: Merge any release branch to uat
on:
  push:
    branches:
      - 'feature/*'
jobs:
  merge-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Merge feature/xxx -> main
        uses: devmasx/merge-branch@master
        with:
          type: now
          target_branch: main
          github_token: ${{ github.token }}

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250