name: 'update parent repositories'

on:
  push:
    branches:
      - dev

jobs:
  sync:
    name: update parent
    runs-on: ubuntu-latest
    strategy:
      matrix:
        repo: ['notion-enhancer/extension']
    steps:
      - name: checkout repo
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.CI_TOKEN }}
          submodules: true
          repository: ${{ matrix.repo }}
      - name: pull updates
        run: |
          git pull --recurse-submodules
          git submodule update --remote --recursive
      - name: commit changes
        uses: stefanzweifel/git-auto-commit-action@v4
        with:
          commit_message: '[${{ github.event.repository.name }}] ${{ github.event.head_commit.message }}'
