name: Update README with latest YouTube videos on: schedule: - cron: '0 */3 * * *' # Runs every 3 hours, not that important lol push: branches: - main # Trigger on push to main branch jobs: update-readme: runs-on: ubuntu-slim steps: - name: Checkout repository uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v3 with: node-version: '20' - name: Update README uses: GalvinPython/youtube-readme@1.1 with: youtube_channel_id: 'UCGJXFC0YsDzVP3ar8RzhCmA' readme_file_path: 'README.md' - name: Configure Git run: | git config --global user.name 'github-actions[bot]' git config --global user.email 'github-actions[bot]@users.noreply.github.com' - name: Commit changes run: | git add README.md git commit -m "Update README with latest YouTube videos" || echo "No changes to commit" - name: Push changes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: git push