Update Flakes #1635
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Flakes | |
on: | |
schedule: | |
- cron: "50 0 * * 0" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
get-flakes: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.get-flakes.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v30 | |
with: | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- name: generate flake matrix | |
id: get-flakes | |
run: | | |
set -euo pipefail | |
flakes="$(nix flake metadata --json | jq -rcM '.locks.nodes.root.inputs | {flake: keys}')" | |
echo "matrix=$flakes" >> "$GITHUB_OUTPUT" | |
flake-update: | |
runs-on: ubuntu-latest | |
needs: | |
- get-flakes | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.get-flakes.outputs.matrix) }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: cachix/install-nix-action@v30 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable-small | |
extra_nix_config: | | |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/create-github-app-token@v1 | |
id: generate-token | |
with: | |
app-id: ${{ secrets.APP_ID }} | |
private-key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: cpcloud/flake-update-action@v2.0.1 | |
with: | |
dependency: ${{ matrix.flake }} | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
pull-request-token: ${{ steps.generate-token.outputs.token }} | |
pull-request-author: "phillip-ground[bot] <phillip-ground[bot]@users.noreply.github.com>" | |
pull-request-labels: dependencies,autorebase:opt-in | |
automerge: true | |
delete-branch: true |