Adds hooks for secrets

This commit is contained in:
Michel Fedde 2025-09-27 15:23:22 +02:00
parent 63fcd502a8
commit 7a56328fad
4 changed files with 50 additions and 11 deletions

13
.config/yadm/hooks/post_commit Executable file
View file

@ -0,0 +1,13 @@
#!/bin/bash
handleSecretChanges() {
secretsFolderPath="$HOME/.local/share/secrets"
message=$(yadm log -1 --format="%s")
hash=$(yadm rev-parse HEAD)
git --git-dir "$secretsFolderPath/.git" --work-tree "$secretsFolderPath" add .
git --git-dir "$secretsFolderPath/.git" --work-tree "$secretsFolderPath" commit -m "$message" -m "Issued from YADM by commit '$hash'"
}
handleSecretChanges