# https://github.com/sw-yx/gh-action-data-scraping
on:
  schedule:
    - cron:  '0 8 * * *' # every day at 8am
name: (Daily Cronjob) Update GitHub Stats For all Code repos
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Build
      run: npm install
    - name: Sort
      run: npm run sort-repositories
    - name: Scrape
      run: npm run githubGetAllData
      env:
        GH_CLIENT_ID: ${{ secrets. GH_CLIENT_ID }} # get this from a github oauth app you set up
        GH_CLIENT_SECRET: ${{ secrets. GH_CLIENT_SECRET }}
    - uses: mikeal/publish-to-github-action@master
      env:
        GITHUB_TOKEN: ${{ secrets. SWYX_TOKEN_FOR_COMMITING }} # we used to use GITHUB_TOKEN, but it had permissions issues
