Allow verified GitHub emails when none are private - #6921
Merged
Alex Ross (alexr00) merged 2 commits intoMay 8, 2025
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`.
Kevin Abel (kabel)
left a comment
Contributor
Author
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).
Alex Ross (alexr00)
approved these changes
May 8, 2025
Alex Ross (alexr00)
left a comment
Member
There was a problem hiding this comment.
Kevin Abel (@kabel), thanks for this PR. I'm likely going to have to release with bug #6916, today, but I'll make a recovery release with this fix tomorrow.
| // 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.
Ulugbek Abdullaev (ulugbekna)
approved these changes
May 8, 2025
Alex Ross (alexr00)
enabled auto-merge (squash)
May 8, 2025 09:09
Member
|
/azp run |
|
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
Alex Ross (alexr00)
enabled auto-merge (squash)
May 8, 2025 10:21
Alex Ross (alexr00)
disabled auto-merge
May 8, 2025 10:21
Alex Ross (alexr00)
enabled auto-merge (squash)
May 8, 2025 10:23
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.