@@ -357,18 +357,18 @@ def group_parse_rows(
357357
358358 for row in rows :
359359 raw_contributor = row .contributor
360- github = cls ._strip (raw_contributor .github )
361- if github :
362- github = github .lstrip ("@" ).lower ()
363360 email = cls ._strip (raw_contributor .email )
364361 if email :
365362 email = email .replace ("!" , "@" ).lower ()
363+ github = cls ._strip (raw_contributor .github )
364+ if github :
365+ github = github .lstrip ("@" ).lower ()
366366 name = cls ._strip (raw_contributor .name )
367367
368- if github :
369- contributor_key = ("github" , github )
370- elif email :
368+ if email :
371369 contributor_key = ("email" , email )
370+ elif github :
371+ contributor_key = ("github" , github )
372372 else :
373373 continue
374374
@@ -584,10 +584,10 @@ def affiliation_stint_key(
584584 contributor : AffiliationContributor , domain : str
585585 ) -> tuple [str , str , str ] | None :
586586 domain = domain .lower ()
587- if contributor .github :
588- return ("github" , contributor .github .lower (), domain )
589587 if contributor .email :
590588 return ("email" , contributor .email .lower (), domain )
589+ if contributor .github :
590+ return ("github" , contributor .github .lower (), domain )
591591 return None
592592
593593 async def exclude_parent_repo_affiliations (
@@ -665,23 +665,23 @@ async def apply_affiliations(
665665 for entry in affiliations :
666666 contributor = entry .contributor
667667 member_idx : int | None = None
668- if contributor .github :
668+ if contributor .email :
669669 member_idx = len (member_identity_inputs )
670670 member_identity_inputs .append (
671671 {
672672 "type" : "username" ,
673- "platform" : "github " ,
674- "value" : contributor .github ,
673+ "platform" : "git " ,
674+ "value" : contributor .email ,
675675 "verified" : True ,
676676 }
677677 )
678- elif contributor .email :
678+ elif contributor .github :
679679 member_idx = len (member_identity_inputs )
680680 member_identity_inputs .append (
681681 {
682- "type" : "email " ,
683- "platform" : None ,
684- "value" : contributor .email ,
682+ "type" : "username " ,
683+ "platform" : "github" ,
684+ "value" : contributor .github ,
685685 "verified" : True ,
686686 }
687687 )
0 commit comments