From 804059f87d2ccf26f7721c61407a0c4a6c9d9e1a Mon Sep 17 00:00:00 2001 From: Eli Ribble Date: Fri, 23 Jan 2026 20:37:55 +0000 Subject: [PATCH] Attempt to check if I have an SSH identity before committing I've lost too many commit messages at this point. --- lefthook.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lefthook.yml b/lefthook.yml index 2dfa23dc..003fb93d 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,5 +1,13 @@ pre-commit: commands: + check-ssh-identity: + run: | + # Check if any SSH identities are available + if ! ssh-add -l &>/dev/null || [ "$(ssh-add -l 2>/dev/null | grep -v 'The agent has no identities.')" = "" ]; then + echo "Error: No SSH identities found in your SSH agent." + echo "Please run 'ssh-add' to add your SSH key before committing." + exit 1 + fi gofmt: glob: "*.go" run: gofmt -w {staged_files}