Skip to content

update-flakes

update-flakes #41

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