30 lines
691 B
Bash
Executable file
30 lines
691 B
Bash
Executable file
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
source "${HOME}/bin/script_framework.sh"
|
|
|
|
### Fix committer email by repo
|
|
|
|
step "Ensure correct commit config..."
|
|
git committerconfig
|
|
|
|
### Commit
|
|
|
|
signingkey=$(git config user.signingkey)
|
|
if [[ $signingkey =~ ^(ssh|ecdsa|key::) ]]; then
|
|
step "Loading ssh key into agent..."
|
|
vault-sshadd $(cut -d ' ' -f 3 <<<"${signingkey}")
|
|
else
|
|
step "Loading passphrase for GPG key..."
|
|
vault-gpg ${signingkey}
|
|
fi
|
|
|
|
step "Execute pre-commit auto-hook"
|
|
git autohook pre-commit
|
|
|
|
step "Issuing commit..."
|
|
COMMIT_OPTS=$(git config --get commit.cliopts 2>/dev/null || echo "")
|
|
git commit -v ${COMMIT_OPTS} "$@"
|
|
|
|
step "Execute post-commit auto-hook"
|
|
git autohook post-commit
|