-
Notifications
You must be signed in to change notification settings - Fork 59
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
Avoid creating merge commit #24
Comments
Yes I would like to know this too. For example when there is no changes to be applied it will create an empty commit that does nothing. |
I have made a pull request that skips merges for fast-forwards |
It would be handy to have a configuration like: allow_fastforward: true |
Is there any update on this issue's original request? In our org we prefer squash merging, and only want to have a single commit on the master/main branch. If anyone is aware of how to make this possible with |
For now I switched to bash script. My use case was to auto sync name: staging flow
on:
workflow_dispatch: # trigger job manually
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Release to staging
run: |
git config user.email "[email protected]"
git config user.name "Organization CI"
git checkout -b staging # staging branch for deployment
git reset --hard main # auto replace staging with main branch for deployment
git push -f --set-upstream origin staging If |
@piyushchauhan2011 I believe there are many prebuilt GH actions for that exact purpose. For anyone looking to merge a PR/branch without a merge commit, this is what I ended up with:
Quite simple in the end. Will see how it holds up over time. In terms of branch protection, scope PATs are probably a cleaner solution than bot accounts. |
Nice 👍🏼 . I agree with PATs, easier to maintain than bot accounts if they are only used for just this purpose |
I want to know if it's possible if we can avoid creating merge commit and do a fast forward with some option. Right now it creates two commits
e.g. https://github.com/piyushchauhan2011/bug-free-palm-tree/commits/staging
The text was updated successfully, but these errors were encountered: