Fix fork divergence: add clean upstream PR workflow, fix rebase merge-base bug, generalize sync backup#84
Merged
Conversation
…improve sync-upstream Co-authored-by: carstenartur <3164220+carstenartur@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add create upstream PR workflow for clean branches
Fix fork divergence: add clean upstream PR workflow, fix rebase merge-base bug, generalize sync backup
Feb 28, 2026
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.
Fork-specific commits were leaking into upstream PRs because the rebase workflow counted commits via the GitHub API (which includes all fork-deviation commits), and the sync workflow only preserved
.github/workflows/files, missingREADME.md,dependabot.yml, etc.Changes
New:
.github/workflows/create-upstream-pr.ymlworkflow_dispatchworkflow to create clean upstream PR branches. Acceptsissue_number,source_branch,commit_shas(comma-separated), and optionalpr_title. Cherry-picks only the specified SHAs onto a freshupstream/master-based branch (upstream-pr/issue-{N}), runs verification (git log+git diff --stat), force-pushes, and outputs the direct PR comparison URL:Fix:
.github/workflows/rebase-upstream.yml— rebase stepReplaced
HEAD~${PR_COMMIT_COUNT}(broken: count from GitHub API includes fork-specific commits) withgit merge-baseto find the true fork point:Also removed the now-unused
commit_countoutput from the "Get PR branch info" step.Fix:
.github/workflows/sync-upstream.yml— backup/restore steps (both scheduled and manual jobs)Replaced the dynamic upstream-diff scan (only caught
.github/workflows/files) with a manifest-driven approach: reads.github/fork-specific-files.txtline by line, backs up each listed file before reset, restores withcp -r+git add -Ato handle any path. Uses POSIX-compatiblecasesyntax instead of[[.New:
.github/fork-specific-files.txtExplicit manifest of fork-specific files to preserve across upstream syncs:
The manifest includes itself so it survives sync resets.
Original prompt
This pull request was created from Copilot chat.
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.