Files
infra-lido/scripts/commit_flake_update.bash

24 lines
664 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (C) develp GmbH 2024 All Rights Reserved
set -euo pipefail
if ! git config --get user.name >/dev/null 2>&1 || \
[ "$(git config --get user.name)" = "" ] ||
! git config --get user.email >/dev/null 2>&1 || \
[ "$(git config --get user.email)" = "" ]; then
echo "git config user.{name,email} is not set - configuring"
set -x
git config --local user.email "actions-bot"
git config --local user.name "actions-bot@users.noreply.github.com"
fi
nix flake update --commit-lock-file
git commit --amend -F - <<EOF
chore(flake.lock): Update all Flake inputs ($(date -I))
$(git log -1 '--pretty=format:%b' | sed '1,2d')
EOF