From e03951f9241be212c954615d0c20ec950ea5f8dc Mon Sep 17 00:00:00 2001 From: Lars Tveito Date: Sat, 20 Jul 2024 02:43:08 +0200 Subject: [PATCH] Create update-flake.yml --- .github/workflows/update-flake.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/update-flake.yml diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml new file mode 100644 index 0000000..09442f7 --- /dev/null +++ b/.github/workflows/update-flake.yml @@ -0,0 +1,30 @@ +name: Update Flake + +on: + schedule: + - cron: '0 0 * * 0' # Runs every Sunday at midnight + workflow_dispatch: + +jobs: + update-flake: + runs-on: macos-latest + + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Set up Nix + uses: cachix/install-nix-action@v27 + + - name: Update flake + run: nix flake update + + - name: Commit and push if there are changes + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "Update flake" || exit 0 + git push