forked from lovesegfault/beautysh
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.7 KB
/
update-flakes.yaml
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: update-flakes
on:
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
get-flakes:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.get-flakes.outputs.matrix }}
steps:
- uses: actions/checkout@v2.3.5
- uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes recursive-nix
- id: get-flakes
run: |
get_flake_inputs() {
nix flake metadata --json \
| jq -c '
.locks.nodes.root.inputs
| {flake: keys}'
}
echo "::set-output name=matrix::$(get_flake_inputs)"
update-flake:
name: update-${{ matrix.flake }}
runs-on: ubuntu-latest
needs: get-flakes
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.get-flakes.outputs.matrix) }}
steps:
- uses: actions/checkout@v2.3.5
- uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
experimental-features = nix-command flakes recursive-nix
- run: git config --global user.email "hatesegfault@protonmail.ch"
- run: git config --global user.name "hatesegfault"
- uses: cpcloud/flake-update-action@v1.0.2
with:
dependency: ${{ matrix.flake }}
pull-request-token: ${{ secrets.PAT }}
pull-request-author: hatesegfault <hatesegfault@protonmail.ch>
delete-branch: true
github-token: ${{ secrets.GITHUB_TOKEN }}
pull-request-branch-prefix: update-
automerge: true