File tree Expand file tree Collapse file tree 1 file changed +17
-24
lines changed Expand file tree Collapse file tree 1 file changed +17
-24
lines changed Original file line number Diff line number Diff line change 11name : submodules-sync
22
33on :
4-
54 push :
65 branches : ['**']
76 tags : ['v*.*.*']
87 pull_request :
98 branches : ['**']
109 release :
1110 types : [published]
12-
13- # Allows you to run this workflow manually from the Actions tab
1411 workflow_dispatch :
1512
1613jobs :
1714 sync :
1815 name : ' Submodules Sync'
1916 runs-on : ubuntu-22.04
2017
21- # Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-22.04, macos-latest, or windows-latest
2218 defaults :
2319 run :
2420 shell : bash
2521
2622 steps :
27- # Checkout the repository to the GitHub Actions runner
28- - name : Checkout
29- uses : actions/checkout@v3
30- with :
31- token : ${{ github.token }}
32- submodules : true
33-
34- # Update references
35- - name : Git Sumbodule Update
36- run : |
37- git config pull.rebase false
38- git pull --recurse-submodules origin main
39- git submodule update --remote --recursive
40-
41- - name : Commit update
42- run : |
43- git config --global user.name 'Git bot'
44- git config --global user.email 'bot@noreply.github.com'
45- git remote set-url origin https://x-access-token:${{ github.token }}@github.com/${{ github.repository }}
46- git commit -am "Auto updated submodule references" && git push || echo "No changes to commit"
23+ - name : Checkout repository with submodules
24+ uses : actions/checkout@v3
25+ with :
26+ token : ${{ secrets.GITHUB_TOKEN }}
27+ submodules : true
28+
29+ - name : Update submodules
30+ run : |
31+ git submodule update --init --remote --recursive
32+
33+ - name : Commit and push submodule updates
34+ run : |
35+ git config --global user.name 'Git bot'
36+ git config --global user.email 'bot@noreply.github.com'
37+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
38+ git add .
39+ git diff --quiet && echo "No changes to commit" || (git commit -m "Auto updated submodule references" && git push)
You can’t perform that action at this time.
0 commit comments