Files
homeprod/.post-commit-sops.sh
vhaudiquet 6ded6f7d28 Add SOPS encryption for env files
(and decryption with SwarmCD)
2025-09-16 21:22:00 +02:00

10 lines
362 B
Bash
Executable File

#!/bin/bash
readarray f < <(git diff-tree --no-commit-id --name-only HEAD -r)
for filepath in "${f[@]}"; do
filepath=$(echo "${filepath}" | tr -d '\n')
filename=$(basename ${filepath})
if [[ "${filename}" =~ values.ya?ml$ ]] || [[ "${filename}" =~ secrets?.ya?ml$ ]] || [[ "${filename}" = ".env" ]]; then
sops -d -i "${filepath}"
fi
done