Skip to content

Commit 5542d8b

Browse files
authored
docs: show how to reject GitHub no-reply author emails (#71)
1 parent 976147e commit 5542d8b

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎docs/guides/policies.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ To require a company address:
7676
author_email_pattern = "^.+@example\\.com$"
7777
```
7878

79+
To refuse GitHub's no-reply addresses, which cannot receive mail and can lose
80+
their link to the author's account after a username change:
81+
82+
```toml title="cchk.toml"
83+
[commit]
84+
author_email_pattern = '(?i)^(?!.*@users\.noreply\.github\.com$).+@.+$'
85+
```
86+
7987
### Bots
8088

8189
Automation cannot meaningfully sign the DCO, and forcing it to produces

‎docs/rules.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,16 @@ git config --global user.email you@example.com
776776
`^.+@.+$`; set something like `"^.+@example\\.com$"` to require a company
777777
domain.
778778

779+
To reject an address instead of requiring one, use a negative lookahead. This
780+
refuses GitHub's no-reply addresses (`jane@users.noreply.github.com` and
781+
`12345+jane@users.noreply.github.com`), which cannot receive mail and can
782+
lose their link to the author's account after a GitHub username change:
783+
784+
```toml title="cchk.toml"
785+
[commit]
786+
author_email_pattern = '(?i)^(?!.*@users\.noreply\.github\.com$).+@.+$'
787+
```
788+
779789
!!! note
780790

781791
Because the built-in pattern only looks for an `@`, local and placeholder

0 commit comments

Comments
 (0)