Skip to content

Commit 96c3155

Browse files
committed
Labs: Fix upstream sync workflow
1 parent 40ef008 commit 96c3155

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/sync.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,24 @@ jobs:
3434
BRANCH_NAME="sync-upstream-$(date +%Y%m%d-%H%M%S)"
3535
3636
git checkout -b $BRANCH_NAME
37-
git merge microsoft/winui3/main --no-edit
3837
39-
# Only push and create PR if merge added commits
38+
if ! git merge microsoft/winui3/main --no-edit; then
39+
echo "Merge conflicts detected"
40+
41+
if git diff --name-only --diff-filter=U | grep -q "src/eng/Version.Details.xml"; then
42+
git checkout --theirs src/eng/Version.Details.xml
43+
git add src/eng/Version.Details.xml
44+
fi
45+
46+
if git diff --name-only --diff-filter=U | grep -q .; then
47+
echo "Non-version conflicts detected - needs manual review"
48+
git merge --abort
49+
exit 1
50+
fi
51+
52+
git commit -m "Resolved Version.Details.xml conflict with upstream version"
53+
fi
54+
4055
if git diff --quiet origin/main; then
4156
echo "Already up to date with upstream"
4257
exit 0
@@ -53,4 +68,4 @@ jobs:
5368
echo "Created PR: $PR_URL"
5469
5570
gh pr merge "$PR_URL" --auto --squash
56-
echo "Auto-merge enabled"
71+
echo "Auto-merge enabled"

0 commit comments

Comments
 (0)