Skip to content

Commit

Permalink
check-email-commit: exception for dependabot (#14532)
Browse files Browse the repository at this point in the history
Commit d935048 by dependabot used an
invalid email address 49699333+dependabot[bot]@users.noreply.github.com
which trips the valid email checker.

Signed-off-by: Maciej Borzecki <[email protected]>
  • Loading branch information
bboozzoo authored Sep 25, 2024
1 parent 9e91a46 commit 75a0c4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion check-commit-email.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ def get_commit_range():
raise RuntimeError("expected two parents, but got {}".format(parents))


def exception_invalid(maybeaddr: str) -> bool:
# from commit d935048f4ee5f9a8cde640a760bf1fdb9409de7e
# dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
if "+dependabot[bot]@users.noreply.github.com" in maybeaddr:
return True
return False


if __name__ == "__main__":
if not os.path.exists('.git'):
exit(0)
Expand All @@ -53,7 +61,7 @@ def get_commit_range():
if potentialemail == "":
continue
name, addr = parseaddr(potentialemail)
if addr == "":
if addr == "" and not exception_invalid(potentialemail):
print(
"Found invalid email %s for commmit %s" % (potentialemail, commithash)
)
Expand Down

0 comments on commit 75a0c4d

Please sign in to comment.