summaryrefslogtreecommitdiff
path: root/.github/workflows/update-flake.yaml
blob: 83911fb833a6bf3a9a92edb0959bf22d19bc90c0 (plain)
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
name: Update flake.lock

on:
  schedule:
    # run every saturday
    - cron: "0 0 * * 6"
  workflow_dispatch:

jobs:
  update:
    name: Run update
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Nix
        uses: DeterminateSystems/nix-installer-action@v12

      - name: Update flake.lock & make PR
        uses: DeterminateSystems/update-flake-lock@v23
        id: update
        with:
          commit-msg: "nix: update flake.lock"
          pr-title: "nix: update flake.lock"
          token: ${{ secrets.MERGE_TOKEN }}

      - name: Enable auto-merge
        if: env.PR_ID != ''
        run: gh pr merge --auto --squash "$PR_ID"
        env:
          GH_TOKEN: ${{ github.token}}
          PR_ID: ${{ steps.update.outputs.pull-request-number }}