Allow verified GitHub emails when none are private#6921
Merged
alexr00 merged 2 commits intomicrosoft:mainfrom May 8, 2025
Merged
Allow verified GitHub emails when none are private#6921alexr00 merged 2 commits intomicrosoft:mainfrom
alexr00 merged 2 commits intomicrosoft:mainfrom
Conversation
See microsoft#6916. If users haven't opted-in to use private email, still allow all secondary email addresses to be used. The REST response shows these email records with `"visibility": null`.
kabel
commented
May 7, 2025
Contributor
Author
kabel
left a comment
There was a problem hiding this comment.
The noreply address suffix may not work as expected on GitHub Enterprise Server. I no longer have access to a enterprise server to verify what the noreply address is there (if it's customized for the on-premise instance).
alexr00
approved these changes
May 8, 2025
| // sort the primary email to the first index | ||
| return data.filter(email => email.visibility === 'public' || email.email.toLowerCase().endsWith('@users.noreply.github.com')).sort((a, b) => +b.primary - +a.primary).map(email => email.email); | ||
| const hasPrivate = data.some(email => email.visibility === 'private'); | ||
| return data.filter(email => hasPrivate ? email.email.endsWith('@users.noreply.github.com') : email.verified) |
Member
There was a problem hiding this comment.
The GitHub API is unclear, but I think this fix makes sense.
ulugbekna
approved these changes
May 8, 2025
Member
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #6916.
If users haven't opted-in to use private email, still allow all secondary email addresses to be used. The REST response shows these email records with
"visibility": null.