A GitHub Action that rebases the current branch onto another branch, attempting to automatically resolve any merge conflicts caused by conflicting dependencies. In the event of a conflicting dependency, the highest version of the dependency is always chosen.
Its functionality is based on this small .NET command-line application.
steps:
- uses: actions/checkout@v3
with:
ref: 'my-branch'
fetch-depth: 0
- uses: martincostello/rebaser@v1
name: rebase
on:
workflow_dispatch:
inputs:
branch:
required: true
type: string
permissions:
contents: write
jobs:
rebase:
runs-on: [ ubuntu-latest ]
concurrency:
group: "rebase-${{ inputs.branch }}"
cancel-in-progress: false
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ inputs.branch }}
- name: Rebase ${{ inputs.branch }}
uses: martincostello/rebaser@v1
id: rebase
- name: Push changes
if : ${{ steps.rebase.outputs.result == 'success' }}
run: git push --force-with-lease origin ${{ inputs.branch }}
Name | Description | Default |
---|---|---|
branch |
The branch to rebase the current branch onto. | github.event.repository.default_branch |
repository |
The path of the repository to rebase. | '.' |
user-email |
The optional email address to use for Git commit(s). | github-actions[bot]@users.noreply.github.com |
user-name |
The optional user name to use for Git commit(s). | github-actions[bot] |
Name | Description |
---|---|
result |
The result of attempting to rebase the branch. The value is one of: upToDate , success , conflicts or error . |
Any feedback or issues can be added to the issues for this project in GitHub.
The repository is hosted in GitHub: https://github.com/martincostello/rebaser.git
This project is licensed under the Apache 2.0 license.