File tree Expand file tree Collapse file tree
apps/merge_suggestions_worker/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,3 +14,8 @@ export const EMAIL_AS_USERNAME_PLATFORMS = [
1414 PlatformType . CONFLUENCE ,
1515 PlatformType . GERRIT ,
1616]
17+
18+ export const noreplyEmailProviders = {
19+ github : '@users.noreply.github.com' ,
20+ gitlab : '@users.noreply.gitlab.com' ,
21+ } as const
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { EMAIL_AS_USERNAME_PLATFORMS } from './enums'
44
55function isNoreplyEmail ( value : string ) : boolean {
66 const lower = value . toLowerCase ( )
7- return lower . endsWith ( '@users.noreply.github.com' ) || lower . endsWith ( '@users.noreply.gitlab.com' )
7+ return [ '@users.noreply.github.com' , '@users.noreply.gitlab.com' ] . some ( ( s ) => lower . endsWith ( s ) )
88}
99
1010export const prefixLength = ( string : string ) => {
Original file line number Diff line number Diff line change @@ -43,12 +43,6 @@ export const parseGitLabNoreplyEmail = (email?: string | null): string | null =>
4343 return username || null
4444}
4545
46- /** Returns true if the value is a provider-generated noreply address. */
47- export const isNoreplyEmail = ( value : string ) : boolean => {
48- const lower = value . toLowerCase ( )
49- return Object . values ( noreplyEmailProviders ) . some ( ( s ) => lower . endsWith ( s ) )
50- }
51-
5246/**
5347 * Returns true if the email host indicates a local machine (not a real mail server).
5448 * Git commits from unconfigured machines often produce addresses like user@hostname.local.
You can’t perform that action at this time.
0 commit comments