submodule-sync #33
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: 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 | |
uses: actions/checkout@v2 | |
- 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 | |
- 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" |