Update Submodules #419
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 | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # runs every day at midnight UTC | |
| workflow_dispatch: # manual trigger | |
| jobs: | |
| update-submodules: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global core.autocrlf input | |
| git config --global core.eol lf | |
| - name: Checkout repository (with submodules) | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update submodules | |
| run: | | |
| git submodule update --remote | |
| git add -A | |
| - name: Check if there are changes | |
| shell: bash | |
| run: | | |
| if git diff --cached --quiet; then | |
| echo "No changes." | |
| echo "changed=false" >> $GITHUB_ENV | |
| else | |
| echo "Submodules updated." | |
| echo "changed=true" >> $GITHUB_ENV | |
| fi | |
| - name: Setup .NET | |
| if: env.changed == 'true' | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.0.x | |
| - name: Run generator | |
| if: env.changed == 'true' | |
| run: | | |
| ./generate.bat | |
| git add -A | |
| - name: Check if it can build | |
| if: env.changed == 'true' | |
| run: dotnet build | |
| - name: Create Pull Request | |
| if: env.changed == 'true' | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| commit-message: Update submodules | |
| committer: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
| author: github-actions[bot] <github-actions[bot]@users.noreply.github.com> | |
| branch: "update-submodules" | |
| delete-branch: true | |
| title: "Update Git submodules" | |
| body: | | |
| This PR updates the Git submodules to their latest commits. | |
| - Auto-generated by GitHub Actions |