File tree 1 file changed +12
-6
lines changed
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 21
21
# Update submodules
22
22
git submodule update --init --remote
23
23
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}"
27
32
28
33
# Check for changes
29
34
git status --porcelain
54
59
git commit -m "Update submodules to latest commits"
55
60
git push origin $BRANCH_NAME
56
61
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
60
66
else
61
67
echo "No submodule updates found"
62
68
fi
You can’t perform that action at this time.
0 commit comments