Submodules Sync #96
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: 'Submodules Sync' | |
on: | |
# Allows you to run this workflow manually from the Actions tab or through HTTP API | |
workflow_dispatch: | |
# run on Sunday at 4:10 AM UTC (11:10 PM US eastern, 8:10 PM US western) | |
schedule: | |
- cron: '10 4 * * 0' | |
jobs: | |
sync: | |
name: 'Submodules Sync' | |
runs-on: ubuntu-latest | |
# Use the Bash shell regardless whether the GitHub Actions runner is ubuntu-latest, macos-latest, or windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
# Checkout the repository to the GitHub Actions runner | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
submodules: true | |
# Update references | |
- name: Git Sumbodule Update | |
run: | | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
- name: Commit update | |
run: | | |
git config --global user.name 'GH actions' | |
git config --global user.email 'bot@noreply.github.com' | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git commit -am "Auto updated submodule references" && git push || echo "No changes to commit" |