Skip to content

Commit 8b8dd13

Browse files
committed
[skip ci]
1 parent ca0733f commit 8b8dd13

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

.github/workflows/update-submodules.yml

+12-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,14 @@ jobs:
2121
# Update submodules
2222
git submodule update --init --remote
2323
24-
# Capture the last commit ID of the submodule
25-
SUBMODULE_COMMIT=$(git -C build rev-parse HEAD)
26-
echo "Submodule commit: $SUBMODULE_COMMIT"
24+
# Collect commit IDs for each submodule
25+
SUBMODULES=$(git submodule--helper list | awk '{ print $4 }')
26+
COMMIT_IDS=""
27+
for SUBMODULE in $SUBMODULES; do
28+
COMMIT_ID=$(git -C $SUBMODULE rev-parse HEAD)
29+
COMMIT_IDS+="\n$SUBMODULE: $COMMIT_ID"
30+
done
31+
echo -e "Submodule commits:${COMMIT_IDS}"
2732
2833
# Check for changes
2934
git status --porcelain
@@ -54,9 +59,10 @@ jobs:
5459
git commit -m "Update submodules to latest commits"
5560
git push origin $BRANCH_NAME
5661
57-
# Create a Pull Request with submodule commit ID in the title
58-
PR_TITLE="Update submodules to latest commits (submodule commit: $SUBMODULE_COMMIT)"
59-
gh pr create --title "$PR_TITLE" --body "This PR updates all submodules to their latest commits." --base master --head $BRANCH_NAME
62+
# Create a Pull Request with submodule commit IDs in the title
63+
PR_TITLE="Update submodules to latest commits"
64+
PR_BODY="This PR updates all submodules to their latest commits.${COMMIT_IDS}"
65+
gh pr create --title "$PR_TITLE" --body "$PR_BODY" --base master --head $BRANCH_NAME
6066
else
6167
echo "No submodule updates found"
6268
fi

0 commit comments

Comments
 (0)