Use gh CLI to make (verified) commit

This commit is contained in:
Judson Lester 2022-10-12 15:58:36 -07:00
parent 0ad9a55048
commit 6f9fc6eab1
No known key found for this signature in database
GPG key ID: 12E21E4B9A3F82AA
2 changed files with 41 additions and 2 deletions

View file

@ -5,12 +5,18 @@ if [[ -n "$PATH_TO_FLAKE_DIR" ]]; then
cd "$PATH_TO_FLAKE_DIR"
fi
commitArg=""
if [[ "$COMMIT_WITH_TOKEN" != true ]]; then
commitArg="--commit-lock-file "
fi
if [[ -n "$TARGETS" ]]; then
inputs=()
for input in $TARGETS; do
inputs+=("--update-input" "$input")
done
nix flake lock "${inputs[@]}" --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
nix flake lock "${inputs[@]}" $commitArg --commit-lockfile-summary "$COMMIT_MSG"
else
nix flake update --commit-lock-file --commit-lockfile-summary "$COMMIT_MSG"
nix flake update $commitArg --commit-lockfile-summary "$COMMIT_MSG"
fi