Skip to content

update_submodules

update_submodules #21

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