Skip to content

Commit fe4c22c

Browse files
committed
Fix subtree automation for submodules when there were no changes
While the prior fixes made sure that submodule changes are picked up, the attempt to commit would fail when there were _no_ changes. See https://github.com/model-checking/verify-rust-std/actions/runs/15878565075/job/44772389751 for a failing run. Now we will only attempt to commit when there are changes.
1 parent 613f27d commit fe4c22c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/update-subtree.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,10 @@ jobs:
198198
# Set submodules to upstream versions
199199
git submodule update --init
200200
git submodule foreach 'grep $sm_path $toplevel/../submodule-heads | cut -f1 -d" " | xargs git checkout'
201-
git -c user.name=gitbot -c user.email=git@bot \
202-
commit -m "Update submodules" library/
201+
if ! git diff --quiet; then
202+
git -c user.name=gitbot -c user.email=git@bot \
203+
commit -m "Update submodules" library/
204+
fi
203205
204206
sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml
205207
git -c user.name=gitbot -c user.email=git@bot \

0 commit comments

Comments
 (0)