Update YouTube stats #946
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update YouTube stats | |
| on: | |
| schedule: | |
| - cron: '0 8 * * *' | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| metadata-update: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout channel config file | |
| uses: actions/checkout@v3.5.3 | |
| with: | |
| sparse-checkout: | | |
| automation/* | |
| README.md | |
| sparse-checkout-cone-mode: false | |
| - name: Update YouTube data | |
| run: | | |
| chmod +x ./automation/youtube-update.sh | |
| ./automation/youtube-update.sh | |
| env: | |
| API_KEY: ${{ secrets.API_KEY }} | |
| WORKSPACE: ${{ github.workspace }} | |
| - name: Save changes | |
| uses: stefanzweifel/git-auto-commit-action@v4 | |
| with: | |
| commit_message: Updated YouTube statistics | |
| commit_author: GitHub Actions <actions@github.com> | |
| file_pattern: 'README.md' |