Skip to content

Update Git Submodules #1196

Update Git Submodules

Update Git Submodules #1196

name: Update Git Submodules
on:
schedule:
- cron: '30 3 * * *'
workflow_dispatch:
jobs:
SubmoduleSync:
name: Update Git Submodules
runs-on: ubuntu-latest
if: github.repository_owner == 'sapphiredev'
steps:
- name: Checkout Project
uses: actions/checkout@v4
with:
token: ${{ secrets.SKYRA_TOKEN }}
submodules: 'recursive'
- name: Install dependencies
uses: sapphiredev/.github/actions/install-yarn-dependencies@main
with:
node-version: 20
- name: Configure Git
run: |
git remote set-url origin "https://${GITHUB_TOKEN}:[email protected]/${GITHUB_REPOSITORY}.git"
git config --local user.email "${GITHUB_EMAIL}"
git config --local user.name "${GITHUB_USER}"
env:
GITHUB_USER: github-actions[bot]
GITHUB_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update all submodules
run: yarn update-submodules
- name: Update lockfile
run: yarn install --mode=update-lockfile
- name: Commit and push any changes
run: |
git add --all .;
if ! git diff-index --quiet HEAD --; then
git commit -snm "chore: updated GitHub Submodules at $(date '+%F %H:%M.%S')"
git push --set-upstream origin $(git rev-parse --abbrev-ref HEAD)
fi