update_submodule #58
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 | |
| on: | |
| repository_dispatch: | |
| types: [update_submodule] | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout meta repo at main | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: latest | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| submodules: false # Avoid broken recursive update | |
| fetch-depth: 0 | |
| # persist-credentials: false | |
| - name: Sync and update submodules | |
| run: | | |
| git submodule sync | |
| git submodule update --init --remote | |
| - name: Commit submodule changes | |
| run: | | |
| git add . | |
| git config user.name "GitHub Action" | |
| git config user.email "action@github.com" | |
| git diff --cached --quiet || git commit -m "Update submodules from ${{ github.event.client_payload.repo }}" | |
| git push |