Update submodules #124
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update submodules | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - name: Update submodules | |
| run: | | |
| git config --file .gitmodules --get-regexp branch | while read -r line; do | |
| submodule=$(echo $line | awk '{print $1}' | sed 's/branch.//'| cut -d'.' -f2) | |
| branch=$(echo $line | awk '{print $2}') | |
| echo "Updating submodule $submodule to branch $branch" | |
| cd $submodule | |
| git checkout $branch | |
| git pull origin $branch | |
| cd .. | |
| done | |
| - name: Push | |
| run: | | |
| git config user.name "oSoWoSo[bot]" | |
| git config user.email "mail@osowoso.org" | |
| #git submodule sync --quiet --recursive | |
| #git submodule update --init --recursive | |
| git add --all | |
| git commit -m "sync" || echo "No changes to commit" | |
| git push |