submodule-sync #313
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
| name: submodule-sync | |
| on: | |
| schedule: | |
| - cron: '0 0 * * 1,3,5' | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| name: 'Submodules Sync' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - name: Checkout | |
| run: | | |
| git init . | |
| git remote add origin https://github.com/${{ github.repository }}.git | |
| git fetch --depth=1 origin ${{ github.ref_name }} | |
| git checkout ${{ github.ref_name }} | |
| - name: Git submodule update | |
| run: | | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/anchor.git HEAD | awk '{ print $1}'),bancho | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/banchobot HEAD | awk '{ print $1}'),bot | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/jobs.git HEAD | awk '{ print $1}'),jobs | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/deck.git HEAD | awk '{ print $1}'),web/deck | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/stern.git HEAD | awk '{ print $1}'),web/stern | |
| git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/keel.git HEAD | awk '{ print $1}'),web/keel | |
| - name: Commit update | |
| run: | | |
| git config user.name 'github-actions[bot]' | |
| git config user.email 'github-actions[bot]@users.noreply.github.com' | |
| git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
| git commit -am "Fast-forward sub-modules" && git push || echo "No changes to commit" |