Replies: 2 comments
-
|
This is a common pain point with linear history workflows. When you do Rebase & Merge, GitHub fast-forwards the commits onto A few ways to handle this: 1. Require branches to be up to date before merging — In your branch protection rules, enable "Require branches to be up to date before merging." This forces the contributor to rebase onto latest 2. Run CI on push to 3. Merge queue — GitHub's merge queue feature automates option 1. It rebases and tests PRs against latest Your linear history approach is totally fine — option 1 is what most teams using rebase workflows go with. |
Beta Was this translation helpful? Give feedback.
-
|
WalkedPlate covered the main approaches. One more option: use GitHub Merge Queue (now GA) which automatically rebases and tests PRs against latest main before merging, ensuring CI ran on the final commit. It works with linear history and protected branches. If you prefer not to enable branch protection, you can also add a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Why are you starting this discussion?
For our repository, we have a protected
mainbranch, we develop in feature branches.Every push to a feature branch which has its PR triggers the run of several workflows.
If the PR is green, the contributor is allowed to click "Rebase & Merge".
I don't want the CI to run again once the PR code is merged, as it was green on the PR. But I do want it to run if anything was rebased.
Suppose the following:
If the user clicks "Rebase & Merge" (can do that if there's no conflict):
The CI is not run! And since the commit history has changed. I'd like it to run.
How can I fix it? Maybe our design of having a linear history is not ideal?
What GitHub Actions topic or product is this about?
CI/CD workflow
Discussion Details
Beta Was this translation helpful? Give feedback.
All reactions