Automatically merge a branch into another.
Inspired by robotology/gh-action-nightly-merge
If the merge is not necessary, the action will do nothing. If the merge fails due to conflicts, the action will fail, and the repository maintainer should perform the merge manually.
To enable the action simply create the .github/workflows/automerge.yml
file with the following content:
name: 'AutoMerge'
on:
schedule:
- cron: '0 0 * * *'
jobs:
automerge:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: true
fetch-depth: 50
- name: AutoMerge
uses: MilleniumStudio/[email protected]
with:
source_branch: 'dev'
destination_branch: 'master'
Even though this action was created to run as a scheduled workflow,
on
can be replaced by any other trigger.
For example, this will run the action whenever something is pushed on the
master
branch:
on:
push:
branches:
- master
The name of the source branch (required).
The name of the destination branch (required).
Allow fast forward merge (default false
). If not enabled, merges will use
--no-ff
.
Refuse to merge and exit unless the current HEAD is already up to date or the
merge can be resolved as a fast-forward (default false
).
Requires allow_ff=true
.
User name for git commits (default GitHub AutoMerge Action
).
User email for git commits (default [email protected]
).