Sync Submodules #23
This file contains hidden or 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
on: | |
schedule: | |
# Run at 11:11 (UTC) every Monday | |
- cron: '11 11 * * 1' | |
# Allow running manually, from the Actions tab or through the GitHub HTTP API | |
workflow_dispatch: | |
name: Sync Submodules | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
if: github.repository == 'bluerobotics/BlueOS' | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Git submodule update | |
run: | | |
git submodule update --init --recursive --remote | |
- name: Commit update | |
run: | | |
git config --global user.name 'Git bot' | |
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 "submodules: Updated references" && git push || echo "No changes to commit" |