Skip to content

Niv Update

Niv Update #115

Workflow file for this run

name: "Niv Update"
on:
workflow_dispatch:
schedule:
# at 17:26 ET (21:26 UTC) every Sunday
- cron: '26 21 * * 0'
jobs:
niv-update:
name: run niv update and create PR with results
runs-on: ubuntu-latest
env:
# lamdera is unfree
NIXPKGS_ALLOW_UNFREE: 1
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
# https://github.com/jlumbroso/free-disk-space/issues/4
large-packages: false
- uses: cachix/install-nix-action@v18
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: |
nix-build --max-jobs 1 -o old
nix-build --max-jobs 1 shell.nix -A inputDerivation -o shell-old
nix-shell nix/niv-shell.nix --run 'niv update'
nix-build --max-jobs 1 -o new
nix-build --max-jobs 1 shell.nix -A inputDerivation -o shell-new
echo "update nix dependencies with niv-update" >> msg
echo >> msg
echo "* changes to nix-build output:" >> msg
echo >> msg
nix-shell nix/niv-shell.nix --run 'nvd diff old new' | sed -E 's/#[0-9]+//' | tail +3 >> msg
echo >> msg
echo "* changes to nix-shell output:" >> msg
echo >> msg
nix-shell nix/niv-shell.nix --run 'nvd diff shell-old shell-new' | sed -E 's/#[0-9]+//' | tail +3 >> msg
echo "COMMIT_MSG<<COMMIT_EOF" >> "$GITHUB_ENV"
cat msg >> "$GITHUB_ENV"
echo "COMMIT_EOF" >> "$GITHUB_ENV"
rm msg old new shell-old shell-new
- uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.ELBUM_BOT_REPOS_WORKFLOWS }}
push-to-fork: Elbum-Bot/elbum
branch: niv/auto-update
author: Nix Updater Bot <[email protected]>
commit-message: "${{ env.COMMIT_MSG }}"
body: "${{ env.COMMIT_MSG }}"
title: update nix dependencies with niv-update