peter-evans / rebase

A GitHub action to rebase pull requests in a repository
MIT License
45 stars 19 forks source link

Add conflict handling. Add Auto Tagging Github Workflow. Use Yarn instead of npm. Auto update README with versions. #58

Closed jamie-wearsafe closed 3 years ago

jamie-wearsafe commented 3 years ago

This primarily adds the feature of adding command hooks for managing conflicts. As per the updated README.

Run commands before and after a rebase to handle rebase conflicts

name: Rebase Open PR's after a Merge to Dev
on:
  push:
    branches:
      - dev
jobs:
  rebase:
    runs-on: Ubuntu-20.04
    steps:
      - uses: peter-evans/rebase@v1.0.5
        with:
          base: dev
          default-branch: dev
          command-to-run-before-rebase: bash -c "grep -m 1 -Po '<version>\K[^<]*' pom.xml > version.tmp"
          command-to-run-on-conflict: bash -c ".github/scripts/fix_version_conflicts.rb -s git -v $(cat version.tmp);git add pom.xml;git commit -m \"Fix merge conflict\""

NOTE: This example is using the ruby script for fixing conflicting version numbers in a pom file for maven projects found here

peter-evans commented 3 years ago

Hi @jamie-wearsafe

While I really appreciate the effort you have put into this, unfortunately I can't merge it. The PR is too large and is changing too much at once. Furthermore, it changes things that one would not expect contributors of an open source project to change, such as the tool chain and CI. As a maintainer, those kind of changes are a no-no, unless you have explicit approval beforehand.

I will take a look at the feature conflict-handling part of this PR and consider if I want to include it separately. It's an interesting idea. 💡