devmasx / merge-branch

A GitHub Action that merge PR branch to other branchs
161 stars 58 forks source link

[Question] Automatic merge from "release/*" to "master" #2

Closed jeffchew closed 4 years ago

jeffchew commented 4 years ago

I'm interested in setting up a flow where any changes (pushes or merged pull requests) to a release branch (release/*) gets automatically merged down to master, and looks like your action might be able to help with that. Would a configuration like this work?

name: Merge release branch to master
on:
  push:
    branches:
      - 'release/*'

jobs:
  automerge:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: Merge to master
        uses: devmasx/merge-branch@v1.1.0
        with:
          type: now
          target_branch: 'master'
        env:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
MiguelSavignano commented 4 years ago

Yes shuld be work. because github send the SHA commit.

octokit.merge(ENV['GITHUB_REPOSITORY'], ENV['INPUT_TARGET_BRANCH'], ENV['GITHUB_SHA'])