File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Nightly job that bumps every git submodule to the latest upstream HEAD
2+ # and opens (or updates) a PR so the change goes through normal review.
3+ name : Update submodules
4+
5+ on :
6+ schedule :
7+ # 03:00 UTC every day
8+ - cron : " 0 3 * * *"
9+ workflow_dispatch :
10+
11+ permissions :
12+ contents : write
13+ pull-requests : write
14+
15+ jobs :
16+ update :
17+ name : Bump submodules to latest HEAD
18+ runs-on : ubuntu-latest
19+
20+ steps :
21+ - name : Checkout (no submodules)
22+ uses : actions/checkout@v4
23+ with :
24+ submodules : false
25+
26+ - name : Update every submodule to remote HEAD
27+ id : update
28+ shell : bash
29+ run : |
30+ git submodule sync
31+ git submodule update --init --remote --depth 1
32+
33+ if git diff --quiet HEAD; then
34+ echo "changed=false" >> "$GITHUB_OUTPUT"
35+ else
36+ echo "changed=true" >> "$GITHUB_OUTPUT"
37+ fi
38+
39+ - name : Push branch and open PR
40+ if : steps.update.outputs.changed == 'true'
41+ uses : peter-evans/create-pull-request@v7
42+ with :
43+ token : ${{ secrets.GITHUB_TOKEN }}
44+ commit-message : " chore: update submodules to latest HEAD"
45+ branch : chore/update-submodules
46+ delete-branch : true
47+ title : " chore: update submodules to latest HEAD"
48+ body : |
49+ Automated nightly submodule update.
50+
51+ This PR was opened by the **Update submodules** workflow. It bumps
52+ every registered git submodule to the latest commit on its remote
53+ default branch.
54+
55+ Merge when CI passes.
56+ labels : dependencies
You can’t perform that action at this time.
0 commit comments