aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/update-yt-dlp.yml
blob: 5754774304d23f4c0deb590a4692bb8ebbdc0987 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: update-yt-dlp

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  update-yt-dlp :
    runs-on: ubuntu-latest
    steps:
      -
        name: Checkout
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.AUTOUPDATE_PAT }}
      -
        name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: '3.8'
      -
        name: Update yt-dlp
        run: |
          pip install pipenv
          pipenv sync
          VER=`pipenv run pip list -o | awk '$1 == "yt-dlp" {print $3}'`
          if [ -n "$VER" ]; then
            pipenv update --selective-upgrade yt-dlp
            git config --global user.email "updater@metube"
            git config --global user.name "AutoUpdater"
            git commit -m 'upgraded yt-dlp' Pipfile.lock
            git push
          fi
bgstack15