Skip to content

Update update-submodules.yml #7

Update update-submodules.yml

Update update-submodules.yml #7

name: Update Submodules
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git remote set-url origin https://x-access-token:${{ secrets.TPA_TOKEN }}@github.com/${{ github.repository }}.git
- name: Update Submodules
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git submodule update --init --remote --force
if [[ $(git status --porcelain) ]]; then
git add .
git commit -m "Update submodules"
git push
else
echo "No changes to commit"
fi