Skip to content

Adopt trunk-based workflow with merge commits on main - #8

Merged
mxwlf merged 1 commit into
mainfrom
chore/trunk-based-workflow
Sep 24, 2026
Merged

mxwlf merged 1 commit into
mainfrom
chore/trunk-based-workflow

Conversation

@mxwlf

@mxwlf mxwlf commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

Makes main the only long-lived branch, and switches it to merge commits so
author signatures survive into the history.

Trunk-based

develop is no longer a stepping stone. Short-lived branches carry one pull
request each and are deleted after merging, so develop-protection is deleted
too — a feature branch needs no rules of its own, because it cannot reach main
except through the CI-gated pull request.

main accepts pull requests from any source branch. The pull_request trigger
needs no head-branch list to allow that; it already fires for a PR from anywhere.
CI triggers narrow to main, and feature branches are left out of the push
trigger so an open PR does not build the same commits twice.

Merge commits, not squash

allowed_merge_methods becomes ["merge"]. A merge commit adds one object and
leaves the branch's commits untouched, so each keeps the signature its author
made, while GitHub signs the merge commit itself to satisfy required_signatures.

The alternatives both rewrite history and lose that:

  • squash collapses the branch into one new GitHub-signed commit — the
    author's own signatures do not reach main.
  • rebase rewrites every commit, discarding the signature outright, and GitHub
    cannot re-sign on the author's behalf. Combined with required_signatures it
    produces a merge button that always fails.

The cost is that main is no longer linear. That is the deliberate trade.

Note on provenance

This branch was cut fresh from main rather than continuing on develop. PR #7
was squash-merged, so main holds that work as a single commit while develop
still holds the originals; re-merging develop would have conflicted against
history that is already collapsed. The tree here is byte-identical to what
develop had.

`main` becomes the only long-lived branch. Short-lived branches carry one pull
request each and are deleted after merging, so `develop` is no longer a stepping
stone and its ruleset is gone — a feature branch needs no protection, since it
cannot reach `main` except through the CI-gated pull request.

`main` now takes merge commits instead of squashes, to preserve authorship: a
merge commit adds one object and leaves the branch's commits untouched, so each
keeps the signature its author made, while GitHub signs the merge commit itself
to satisfy `required_signatures`. Squashing would have collapsed them into one
GitHub-signed commit, discarding the author's signatures. The cost is that
`main` is no longer linear.

CI triggers narrow to `main` on both stubs. The pull_request trigger needs no
source-branch list — it fires for a PR from any branch — and leaving feature
branches out of the push trigger avoids building the same commits twice.

Also documents that `rulesets-apply` never deletes, which is why removing
develop-protection.json did not remove the ruleset from GitHub.
@mxwlf
mxwlf merged commit 60d0386 into main Sep 24, 2026
1 check passed
@mxwlf
mxwlf deleted the chore/trunk-based-workflow branch September 24, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant