mirror of
https://github.com/thegeneralist01/archivr
synced 2026-07-21 18:55:36 +02:00
ci: weekly yt-dlp auto-update workflow
This commit is contained in:
parent
e181fe4c40
commit
d3a78da766
2 changed files with 53 additions and 0 deletions
51
.github/workflows/update-ytdlp.yml
vendored
Normal file
51
.github/workflows/update-ytdlp.yml
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
name: Update yt-dlp
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 6 * * 1' # Every Monday at 06:00 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
update:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: DeterminateSystems/nix-installer-action@main
|
||||
|
||||
- uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
|
||||
- name: Get current yt-dlp version
|
||||
id: before
|
||||
run: |
|
||||
rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)
|
||||
version=$(nix eval --raw "github:nixos/nixpkgs/${rev}#yt-dlp.version")
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Update nixpkgs
|
||||
run: nix flake update nixpkgs
|
||||
|
||||
- name: Get new yt-dlp version
|
||||
id: after
|
||||
run: |
|
||||
rev=$(jq -r '.nodes.nixpkgs.locked.rev' flake.lock)
|
||||
version=$(nix eval --raw "github:nixos/nixpkgs/${rev}#yt-dlp.version")
|
||||
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Open PR if yt-dlp was updated
|
||||
if: steps.before.outputs.version != steps.after.outputs.version
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
with:
|
||||
branch: auto/yt-dlp-update
|
||||
delete-branch: true
|
||||
commit-message: "chore: yt-dlp ${{ steps.before.outputs.version }} → ${{ steps.after.outputs.version }}"
|
||||
title: "chore: yt-dlp ${{ steps.before.outputs.version }} → ${{ steps.after.outputs.version }}"
|
||||
body: |
|
||||
Automated `flake.lock` update. yt-dlp bumped from `${{ steps.before.outputs.version }}` to `${{ steps.after.outputs.version }}`.
|
||||
|
||||
Triggered by the weekly nixpkgs check.
|
||||
labels: dependencies
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -1,6 +1,8 @@
|
|||
*
|
||||
|
||||
!.gitignore
|
||||
!.github/
|
||||
!.github/**
|
||||
|
||||
!docs/
|
||||
!docs/LICENSE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue