From d2f2e1120fa3abc70c29ba0238e8b17c28a2ed49 Mon Sep 17 00:00:00 2001 From: Rohan Mukherjee Date: Sun, 26 Sep 2021 14:46:22 +0530 Subject: [PATCH] chore(actions): added cron job to update submodules (#9) * ci(cron): added cron job to update submodules * fix(cron): schedule changed to every 5 minutres --- .github/workflows/cron.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/cron.yml diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml new file mode 100644 index 0000000..8df1ebc --- /dev/null +++ b/.github/workflows/cron.yml @@ -0,0 +1,44 @@ +name: Update submodules + +on: + schedule: + - cron: "*/5 * * * *" + +jobs: + submodule-update: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: recursive + + - uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + + - name: npm install + run: | + npm install + + - name: Setup git config + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Update submodules + run: | + git submodule update --remote + + - name: Check for build errors + run: | + npm run build:lib + + - name: Commit and push + run: | + git add . + git diff --quiet && git diff --staged --quiet || git commit -m "fix(submodules): submodules were updated" + git push origin main + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file