Skip to content

Commit b575fcf

Browse files
committed
Fix: Handle submodule conflicts during rebase
1 parent a54caf5 commit b575fcf

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/stable-sync.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,22 @@ jobs:
130130
fi
131131
BRANCH_NAME="stable-main-${{ inputs.semver-version }}"
132132
if git ls-remote --heads origin "$BRANCH_NAME" | grep -q "$BRANCH_NAME"; then
133-
git pull --rebase --strategy-option=theirs
133+
# Configure git to ignore submodules during operations
134+
git config submodule.recurse false
135+
git config diff.ignoreSubmodules all
136+
137+
# Start the rebase
138+
if ! git pull --rebase --strategy-option=theirs --no-recurse-submodules; then
139+
echo "Rebase had conflicts, attempting to resolve..."
140+
# If rebase failed, likely due to submodule conflict
141+
# Remove github-tools and mark as resolved
142+
rm -rf github-tools
143+
git rm -rf --cached github-tools 2>/dev/null || true
144+
git add -A
145+
# Continue the rebase
146+
git rebase --continue || true
147+
fi
148+
134149
# Remove github-tools again after rebase in case it was reintroduced
135150
rm -rf github-tools
136151
git rm -rf --cached github-tools 2>/dev/null || true

0 commit comments

Comments
 (0)