Skip to content

Add ability to forbid email addresses with user-specified expressions #651

Closed

Description

@ngie-eign

What's the problem this feature will solve?

Some projects, like FreeBSD, do not accept commits from anonymous authors, such as jane.doe@users.noreply.github.com [1]. This is because GitHub author usernames can be changed [2], breaking the account email provided by GitHub.

Describe the solution you'd like

  • Being able to specify a regex (in the vein of author-email) which forbids certain email domains/patterns is desirable, for flexibility reasons.
  • Having a way to forbid GitHub email addresses using a boolean toggle would be a nice bonus, but it's not a requirement.

Additional context

  1. https://docs.github.com/en/account-and-profile/how-tos/email-preferences/setting-your-commit-email-address#setting-your-commit-email-address-on-github
  2. https://docs.github.com/en/account-and-profile/how-tos/account-management/changing-your-username

Activity

  1. shenxianpeng commented on Nov 4, 2026

    @shenxianpeng
    Member

    Thanks! This already works with author_email_pattern and a negative lookahead:

    [commit]
    author_email_pattern = '(?i)^(?!.*@users\.noreply\.github\.com$).+@.+$'

    Run it with --author-email (or author-email: true in the Action). I've added this example to the docs in commit-check/commit-check.com#71.

  2. ngie-eign commented on Nov 5, 2026

    @ngie-eign
    Author

    Hm. I didn't think about that possibility - thanks for documenting it :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions