From 11f78a0e397d65c75c5ad8c9a51cceb60300c36f Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Thu, 14 Dec 2023 17:43:17 -0800 Subject: use the `update-flake-lock` to update nix flakes This is a better code than whatever I was doing in the first place. --- .github/workflows/update.yml | 34 +++++++++++++++++++--------------- 1 file 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 -- cgit 1.4.1