#!/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 [ $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 echo "All contributors:" git log --pretty=format:' - %ae' CONTRIBUTORS |sort |uniq |sort -f | sed "s/@/$antispam/" echo "Author $authorAt NOT found in list" echo cat <