-
Notifications
You must be signed in to change notification settings - Fork 17
42 lines (38 loc) · 1.42 KB
/
update-flake-lock.yml
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
name: Update flake.lock
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 0" # weekly
permissions:
contents: write
pull-requests: write
jobs:
lockfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Update nixpkgs input to unstable
run: |
sed -i 's|hydenix-nixpkgs.url = "github:nixos/nixpkgs/.*"|hydenix-nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"|' flake.nix
- name: Update flake.lock
run: nix flake update
- name: Update flake.nix with new rev
run: |
NEW_REV=$(jq -r '.nodes."hydenix-nixpkgs".locked.rev' flake.lock)
sed -i "s|hydenix-nixpkgs.url = \"github:nixos/nixpkgs/.*\"|hydenix-nixpkgs.url = \"github:nixos/nixpkgs/$NEW_REV\"|" flake.nix
- name: Check flake
id: check
continue-on-error: true
run: nix flake check
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore(deps): update flake.lock"
title: "chore(deps): update flake.lock"
branch: update-flake-lock-${{ github.run_id }}
delete-branch: true
body: |
Updated flake.lock file.
Flake check status: ${{ steps.check.outcome == 'success' && '✅ Passed' || '❌ Failed' }}