File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Update Submodules
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ schedule :
8+ - cron : ' 0 0 * * *'
9+ workflow_dispatch :
10+
11+ jobs :
12+ update-submodules :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Check out repository
17+ uses : actions/checkout@v3
18+ with :
19+ submodules : recursive
20+ token : ${{ secrets.GITHUB_TOKEN }}
21+
22+ - name : Update submodules to remote HEAD
23+ run : |
24+ git submodule sync --recursive
25+ git submodule update --init --recursive --remote
26+
27+ - name : Check if there are changes
28+ run : |
29+ if [ -n "$(git status --porcelain)" ]; then
30+ git config user.name "github-actions[bot]"
31+ git config user.email "github-actions[bot]@users.noreply.github.com"
32+ git add .
33+ git commit -m "chore: update submodules to latest"
34+ else
35+ echo "No changes to commit."
36+ fi
37+
38+ - name : Push changes
39+ if : always()
40+ run : |
41+ if [ -n "$(git log -1 --pretty=%B | grep 'chore: update submodules')" ]; then
42+ git push origin HEAD:${{ github.ref_name }}
43+ fi
You can’t perform that action at this time.
0 commit comments