-
Notifications
You must be signed in to change notification settings - Fork 4
36 lines (29 loc) · 1.48 KB
/
submodule-sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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
git update-index --cacheinfo 160000,$(git ls-remote https://github.com/osuTitanic/osz2-service.git HEAD | awk '{ print $1}'),web/osz2-service
- 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"