-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (47 loc) · 1.66 KB
/
scheduled_yt-dlp_check.yaml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Yt-dlp Updater
on:
workflow_dispatch:
schedule:
- cron: 57 7 * * * # At 07:57 on every day
jobs:
check:
name: Check Latest Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.latest.outputs.release }}
isNew: ${{ steps.summary.outputs.isNew }}
steps:
- uses: actions/checkout@v4
- name: Read current Yt-dlp Version
id: current
run: |
echo "version=$(cat .yt-dlprc)" >> $GITHUB_OUTPUT
- name: Latest Release
id: latest
uses: pozetroninc/[email protected]
with:
repo: yt-dlp
owner: yt-dlp
excludes: prerelease,draft
- name: Summary
id: summary
run: |
echo "# Yt-dlp Version Check" >> $GITHUB_STEP_SUMMARY
echo "The **currently** used yt-dlp version is \`${{ steps.current.outputs.version }}\`." >> $GITHUB_STEP_SUMMARY
echo "The **latest** yt-dlp version is \`${{ steps.latest.outputs.release }}\`." >> $GITHUB_STEP_SUMMARY
if [ "${{ steps.current.outputs.version }}" = "${{ steps.latest.outputs.release }}" ]; then
echo "isNew=false" >> $GITHUB_OUTPUT
echo "The version is up to date. No update was triggered" >> $GITHUB_STEP_SUMMARY
else
echo "isNew=true" >> $GITHUB_OUTPUT
echo "A new version is available. An update was triggered." >> $GITHUB_STEP_SUMMARY
fi
update:
name: Update Version
needs:
- check
if: needs.check.outputs.isNew == 'true'
uses: ./.github/workflows/yt-dlp_update.yaml
secrets: inherit
with:
version: ${{ needs.check.outputs.version }}