name: Refresh Citation Style Language Files

on:
  schedule:
    # run on 1th and 15th of each month
    - cron: '1 2 1,15 * *'

jobs:
  publish:
    name: Refresh Citation Style Language Files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout source
        uses: actions/checkout@v1
      - name: Add csl-styles remote
        run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git
      - name: Update csl-styles
        run: git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash
      - name: Add csl-locales remote
        run: git remote add -f csl-locales https://github.com/citation-style-language/locales.git
      - name: Update csl-locales
        run: git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash
      - uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Add scheduled update for sub trees
Add scheduled update for sub trees
