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

on:
  schedule:
    - cron: "0 0 * * 6"
  workflow_dispatch:

jobs:
  update:
    runs-on: "ubuntu-latest"

    permissions:
      contents: write
      pull-requests: write

    steps:
      - uses: actions/checkout@v4

      - name: Install Nix
        uses: nixbuild/nix-quick-install-action@v26

      - name: Update lockfile
        uses: DeterminateSystems/update-flake-lock@v20
        id: update
        with:
          token: ${{ github.token }}

      - name: Merge PR
        shell: bash
        run: gh pr merge --rebase "$PR_ID"
        env:
          GH_TOKEN: ${{ github.token }}
          PR_ID: ${{ steps.update.outputs.pull-request-number }}