Merge the source
branch into the target
branch and push the merge commit on the target
branch.
- Only works on the current repository.
- Completely self contained, no checkout needed. Doesn't touch the files on the runner.
Required Target branch of the merge operation, 'ours'.
Optional (default: ${GITHUB_REF##*/}
) Source branch to merge into the target branch, 'theirs'. Defaults to the branch this action is running on.
Optional (default: empty) Comma separated list of options for the ort
merge strategy.
Optional (default: [email protected]
) The git config user.email
for the merge commit.
Optional (default: git merge action
) The git config user.name
for the merge commit.
Optional (default: false
) Execute a dry run. All steps are executed, but no updates are pushed.
Optional (default: ${{ github.token }}
) Personal access token (PAT) used to access the repository. The PAT is stored on a remove-after-run docker container.
name: Merge any release branch into dev
on:
push:
branches:
- 'releases/**'
jobs:
merge:
runs-on: ubuntu-latest
steps:
- uses: morbalint/git-merge-action@v1
with:
target: 'dev'
strategy_options: 'ours'
- Generate a Personal Access Token (PAT) with repo scope and substitute it with the stars in the command below.
- Change the GITHUB_REPOSITORY variable to your fork.
- Run this command with parameters relevant to your change:
docker run --rm -e "INPUT_SOURCE=dev" -e "INPUT_TARGET=test/dev-clone" -e "INPUT_DRY_RUN=true" -e "INPUT_TOKEN=******" -e "GITHUB_SERVER_URL=https://github.com" -e "GITHUB_REPOSITORY=morbalint/git-merge-action" --workdir=/src -v "$(pwd):/src" $(docker build -q .)
The test.yml
runs the following scenarios:
simple-merge
: Dry run of merging branches with two changes made to different filesmirror-dev
: Fast forward merge with actual push to detect pushing issues.
The Dockerfile and associated scripts and documentation in this project are released under the MIT License.