DX-2103: auto-merge the public-export PR after CI#35
Merged
Conversation
Removes the manual merge step (#3) from the release flow. When CI passes on the Copybara-generated copybara/public-export branch, this workflow merges the export PR automatically. Destination main still changes only through that PR, so the export contract is preserved — a human is just no longer required to click merge. Triggered off a successful CI workflow_run (works regardless of branch-protection settings), guarded to the export bot's PR on the export branch, refuses to merge a commit newer than the one CI validated, and uses a merge commit so the Copybara CioCliPublicExport-RevId trailer stays in main's history.
newhook
previously approved these changes
Jun 12, 2026
main's ruleset enforces required_linear_history and allows the rebase merge method only, so the prior --merge call would have been rejected on every run. Switch to --rebase. The CioCliPublicExport-RevId trailer lives in the commit message and survives a rebase, so Copybara last-rev tracking is unaffected — confirmed by main's existing history, which is fully linear and carries the trailer on every export commit.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Final structural follow-up (#5) for DX-2103: remove the manual merge step. When CI passes on the Copybara-generated
copybara/public-exportbranch, this workflow merges the export PR automatically — so cutting a release no longer requires a human to click merge on the mirror.How
New destination-owned workflow
.github/workflows/auto-merge-export.yml:workflow_runof CI (completed), so it only fires after CI has actually run and passed. Usesworkflow_runrather than native branch-protection auto-merge so it works regardless of repo protection settings.conclusion == success, head branch iscopybara/public-export, same-repo (not a fork), PR author is the export bot (ami-ci), and the PR head still matches the exact commit CI validated (refuses to merge a newer, unvalidated push).CioCliPublicExport-RevIdtrailer used for last-rev tracking — stays inmain's history.Why this is safe / preserves the contract
Destination
mainstill changes only through the export PR — this just removes the human from clicking merge, it doesn't bypass the PR or its CI. The release workflow (npm / GitHub release) is unchanged and remains separately gated.Independent of the other DX-2103 PRs
No dependency on #109 (auto-export on merge), #33 (auto-semver), or #112/#34. It auto-merges whatever export PR exists — works with today's manual export and composes with #109 for the fully hands-off pipeline.
Prerequisite
Repo Settings → Actions → Workflow permissions must allow read/write (so
GITHUB_TOKENcan merge). Branch protection must not require a human review onmain(it currently doesn't).Note
This is the change that removes the last human gate before public
main. Per the DX-2103 discussion that's a policy call (Joey leaned toward keeping a human reviewing the changelog/version) — opening it as an isolated, easy-to-revert PR so it's ready, but it shouldn't merge until that's settled.