anki/.buildkite/linux/check_contributors
2020-12-09 21:01:11 +10:00

18 lines
505 B
Bash
Executable File

#!/bin/bash
set -eu -o pipefail ${SHELLFLAGS}
antispam=", at the domain "
headAuthor=$(git log -1 --pretty=format:'%ae')
authorAt=$(echo "$headAuthor" | sed "s/@/$antispam/")
if git log --pretty=format:'%ae' CONTRIBUTORS | grep -i "$headAuthor" > /dev/null; then
echo "Author $authorAt found in CONTRIBUTORS"
else
echo "All contributors:"
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/"
echo "Author $authorAt NOT found in list"
exit 1
fi