anki/.buildkite/linux/check_contributors

27 lines
887 B
Plaintext
Raw Normal View History

2020-01-06 06:37:21 +01:00
#!/bin/bash
set -eu -o pipefail ${SHELLFLAGS}
2020-01-06 06:37:21 +01:00
2020-01-15 11:34:10 +01:00
antispam=", at the domain "
2020-01-06 06:37:21 +01:00
headAuthor=$(git log -1 --pretty=format:'%ae')
2020-01-15 11:34:10 +01:00
authorAt=$(echo "$headAuthor" | sed "s/@/$antispam/")
2023-01-07 00:53:29 +01:00
if [ $headAuthor = "49699333+dependabot[bot]@users.noreply.github.com" ]; then
echo "Dependabot whitelisted."
elif git log --pretty=format:'%ae' CONTRIBUTORS | grep -i "$headAuthor" > /dev/null; then
echo "Author found in CONTRIBUTORS"
else
2020-12-09 12:01:11 +01:00
echo "All contributors:"
git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/"
2020-01-15 11:34:10 +01:00
echo "Author $authorAt NOT found in list"
echo
cat <<EOF
Please make sure you modify the CONTRIBUTORS file using the email address you
are committing from. If you have GitHub configured to hide your email address,
you may need to make a change to the CONTRIBUTORS file using the GitHub UI,
then try again.
EOF
exit 1
fi