about summary refs log tree commit diff
path: root/.github/workflows
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2023-12-14 17:43:17 -0800
committerFranck Cuny <franck@fcuny.net>2023-12-14 17:44:02 -0800
commit11f78a0e397d65c75c5ad8c9a51cceb60300c36f (patch)
tree0ca927b63c12432b6977984a73289f90b8e8fb53 /.github/workflows
parentuse devshell to build / switch the configuration (diff)
downloadworld-11f78a0e397d65c75c5ad8c9a51cceb60300c36f.tar.gz
use the `update-flake-lock` to update nix flakes
This is a better code than whatever I was doing in the first place.
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/update.yml34
1 files changed, 19 insertions, 15 deletions
diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml
index 4503baa..2723a6f 100644
--- a/.github/workflows/update.yml
+++ b/.github/workflows/update.yml
@@ -1,24 +1,28 @@
-name: Nix Autoupdater
+name: 'Update flake.lock'
 on:
-  workflow_dispatch: {}
+  workflow_dispatch:
   schedule:
-    - cron: "0 0 * * *"
+    - cron: '30 5 * * 0'
+# you need to grant permissions to create PR:
+# https://github.com/DeterminateSystems/update-flake-lock/issues/75
 jobs:
-  update-packages:
+  update-flake-lock:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
-      - uses: cachix/install-nix-action@v24
+      - name: Checkout repository
+        uses: actions/checkout@v4
+      - name: Install Nix
+        uses: cachix/install-nix-action@v23
         with:
           extra_nix_config: |
             access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
-            accept-flake-config = true
-      - run: |
-          nix shell nixpkgs#git -c git config user.name 'NixBot'
-          nix shell nixpkgs#git -c git config user.email 'fcuny@users.noreply.github.com'
-          nix flake update
-          nix shell nixpkgs#git -c git commit -am "[Auto] update all inputs"
-      - name: Commit & Push changes
-        uses: actions-js/push@v1.4
+      - name: Update flake.lock
+        id: update-flake-lock
+        uses: DeterminateSystems/update-flake-lock@v20
         with:
-          github_token: ${{ secrets.GITHUB_TOKEN }}
+          pr-title: "Update flake.lock"
+          commit-msg: "chore: update flake"
+          pr-assignees: fcuny
+          pr-labels: |
+            dependencies
+            automated