name: "youutbe downlaoder"

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Clone repository
        uses: actions/checkout@v4

      - name: download video
        run: |
          git config --local user.email "xx"
          git config --local user.name "xx"
          git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
          git pull --rebase
          ./bin/youtube-dl -o "downloads/%(id)s.%(ext)s" --batch-file='./playlist.txt'
          git add .
          git commit -m "download youtube video"
          git push