Skip to content

Commit c03d84f

Browse files
committed
Update sync-upstream workflow to handle fork-specific changes
Refined the merge process to preserve fork-specific deletions and overrides, ensuring smoother integration with upstream changes. Added explicit handling for `pyproject.toml` and fork-specific workflow removals to avoid manual resolution.
1 parent 86d3074 commit c03d84f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/sync-upstream.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,15 @@ jobs:
5252
- name: Configure Git merge driver
5353
run: git config merge.ours.driver true
5454

55-
- name: Merge upstream/${{ env.UPSTREAM_BRANCH }} into unstable
55+
- name: Merge upstream into unstable (keep fork deletions/overrides)
5656
run: |
5757
set -e
58-
git merge -s recursive -X ours upstream/${{ env.UPSTREAM_BRANCH }} || {
59-
echo "❌ Merge conflict. Please resolve manually." >&2
60-
git merge --abort || true
61-
exit 1
62-
}
58+
git merge -s recursive -X ours upstream/${{ env.UPSTREAM_BRANCH }} || true
59+
git checkout --ours pyproject.toml || true
60+
git add pyproject.toml
61+
git rm -f .github/workflows/build.yml || true
62+
git add -u
63+
git commit -m "Merge upstream/${{ env.UPSTREAM_BRANCH }} into unstable, keeping fork deletions/overrides" || echo "No commit needed"
6364
git push origin ${{ env.UNSTABLE_BRANCH }}
6465
6566
- name: Run tests on unstable

0 commit comments

Comments
 (0)