From 017e0ac124f0bf8ffc810be896eba3499310bf69 Mon Sep 17 00:00:00 2001 From: Ben Pearce Date: Sun, 12 Nov 2023 12:44:10 +0000 Subject: [PATCH] Adding workflow to automate submodule sync --- .github/workflows/submodule-sync.yml | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/submodule-sync.yml diff --git a/.github/workflows/submodule-sync.yml b/.github/workflows/submodule-sync.yml new file mode 100644 index 0000000..19ad972 --- /dev/null +++ b/.github/workflows/submodule-sync.yml @@ -0,0 +1,34 @@ +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://git.solero.me/solero/vanilla-media.git/ HEAD | awk '{ print $1}'),vanilla-media + git update-index --cacheinfo 160000,$(git ls-remote https://git.solero.me/solero/legacy-media.git/ HEAD | awk '{ print $1}'),legacy-media + git update-index --cacheinfo 160000,$(git ls-remote https://github.com/solero/houdini.git/ HEAD | awk '{ print $1}'),houdini + git update-index --cacheinfo 160000,$(git ls-remote https://github.com/solero/dash.git/ HEAD | awk '{ print $1}'),dash + + - 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" \ No newline at end of file