File tree 1 file changed +10
-8
lines changed
1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 16
16
submodules : ' recursive'
17
17
18
18
- name : Update submodules
19
+ id : update
19
20
run : |
21
+ # Update submodules
20
22
git submodule update --init --remote
21
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"
27
+
28
+ # Check for changes
22
29
git status --porcelain
23
30
if [ -n "$(git status --porcelain)" ]; then
24
31
echo "Submodule updates found"
@@ -47,16 +54,11 @@ jobs:
47
54
git commit -m "Update submodules to latest commits"
48
55
git push origin $BRANCH_NAME
49
56
50
- # Create a Pull Request
51
- gh pr create --title "Update submodules" --body "This PR updates all submodules to their latest commits." --base master --head $BRANCH_NAME
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
52
60
else
53
61
echo "No submodule updates found"
54
62
fi
55
63
env :
56
64
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
57
-
58
- - name : Cleanup branches (Optional)
59
- run : |
60
- # Clean up local branches that are no longer on the remote
61
- git fetch --prune
62
- git branch -vv | awk '/: gone]/ {print $1}' | xargs git branch -d
You can’t perform that action at this time.
0 commit comments