-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting merge method through labels #92
Conversation
Something like what the title suggest would be awesome!
Which also means that the mentioned gh-find-current-pr action needs to have all the same logic finding the correct PR based on the events, which is tricky, not only from a maintenance perspective. Personally I would still prefer that it's a new feature that is enabled via an option,
|
|
Just checked your code again and realized that I misunderstood it when I first read it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love it :)
Hey, sorry for the delay! I think this is a nice feature, but I know that there are several people who use highly customized configuration values, so forcing the fixed merge/rebase/squash suffixes feels wrong to me. Instead, my suggestion would be the following, although maybe not ideal, either:
I think with these 2 changes, we will keep the flexibility of the action, while still achieving the goal of this PR. Unfortunately, I think this is a bit more effort than the current PR, but I think it would be worth it. Let me know what you think! |
|
Just wanted to throw my hat in the loop, would love to see this. MY current work around is to use env variables which are set using something like: - run echo ::set-env name=mergeType::"squash" and when paired with a standard if statement, allows for both a complex and quick solution.
So my version of this would look like: jobs:
detect:
runs-on: ubuntu-latest
steps:
- id: detectPR
uses: "bettermarks/gh-find-current-pr@bettermarks"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- run: |
if [ ${{steps.detectPR.outputs.label_autorebase}} == false ]; then echo ::set-env name=mergeType::"squash" ;
else echo ::set-env name=mergeType::"rebase" ; fi
- name: Automerge
if: success()
uses: "pascalgn/automerge-action@master"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
MERGE_DELETE_BRANCH: "true"
MERGE_METHOD: ${{env.mergeType}} |
Not sure about this one. How would it be possible to customize the labels then, if someone wants to have e.g. merge/rebase/squash as labels?
Yes, that's better than what I suggested! 👍 |
@pascalgn Pushed the changes including the 2 points I mentioned. |
Thanks for the PR, it's merged now! 👍 |
Hi, this PR is meant also as a jumping off point for discussion around the idea. I'm not that attached to the exact names but using labels like this seems like a ergonomic, backwards compatible way to support changing the merge method for specific PRs.