Skip to content

Commit

Permalink
try this
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyhaibin committed Dec 6, 2024
1 parent 7067c99 commit c3ed8c6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions release/check-submodules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ while read hash submodule ref; do
git -C $submodule remote set-url origin $REPO_URL
git -C $submodule fetch --depth 100 origin $BRANCH_NAME
git -C $submodule branch -r --contains $hash | grep "origin/$BRANCH_NAME"
if [ "$?" -eq 0 ]; then
echo "$submodule ok"
else
echo "$submodule: $hash is not on $BRANCH_NAME"
exit 1
if ! git -C $submodule branch -r --contains $hash | grep -q "origin/$BRANCH_NAME"; then
echo "$submodule: $hash is not on $BRANCH_NAME in fork. Falling back to main repo."

MAIN_SUBMODULE_URL="$MAIN_REPO_URL/$submodule"
git -C $submodule remote set-url main "$MAIN_SUBMODULE_URL"
git -C $submodule fetch --depth 100 main master

if ! git -C $submodule branch -r --contains $hash | grep -q "main/master"; then
echo "$submodule: $hash is not on $BRANCH_NAME or master in the main repo."
exit 1
fi
fi

echo "$submodule ok"
done <<< $(git submodule status --recursive)

0 comments on commit c3ed8c6

Please sign in to comment.