mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
Added script to configure auto gpg signing
This commit is contained in:
18
scripts/git.configure-auto-gpg-sign.bash
Executable file
18
scripts/git.configure-auto-gpg-sign.bash
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/zsh
|
||||||
|
|
||||||
|
: "${USER_EMAIL:?required but not set}"
|
||||||
|
|
||||||
|
: "${SIGNING_KEY:=$(\
|
||||||
|
gpg --list-keys --keyid-format short "${USER_EMAIL}" \
|
||||||
|
| grep --extended-regexp '^pub[[:blank:]]+[[:alnum:]]+/[[:alnum:]]+[[:blank:]].*\[[[:upper:]]*S[[:upper:]]*\]' \
|
||||||
|
| awk '{print $2}' \
|
||||||
|
| cut -d '/' -f 2 )}"
|
||||||
|
: "${SIGNING_KEY:?something went wrong}"
|
||||||
|
|
||||||
|
for REPOSITORY in $(find $@ -type d -name .git -exec dirname {} +)
|
||||||
|
do
|
||||||
|
git -C "$REPOSITORY" config --local user.email "$USER_EMAIL"
|
||||||
|
git -C "$REPOSITORY" config --local user.signingKey "$SIGNING_KEY"
|
||||||
|
git -C "$REPOSITORY" config --local commit.gpgsign true
|
||||||
|
git -C "$REPOSITORY" --no-pager config --list --show-origin
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user