update_submodules #21
This file contains 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: | |
repository_dispatch: | |
types: [update_submodules] | |
jobs: | |
update: | |
if: github.ref == 'refs/heads/main' # Only run on the main branch | |
permissions: | |
contents: write | |
actions: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
persist-credentials: true | |
token: ${{ secrets.REGISTRY_TOKEN }} | |
- name: Update submodules | |
env: | |
GITHUB_TOKEN: ${{ secrets.REGISTRY_TOKEN }} | |
run: | | |
git submodule update --init && git submodule update --remote | |
git config --global user.name "${{ secrets.NAME }}" | |
git config --global user.email "${{ secrets.EMAIL }}" | |
git add . | |
git commit -m "Update submodules" || echo "No changes to commit" | |
git push |