Skip to content

Allow verified GitHub emails when none are private - #6921

Merged
Alex Ross (alexr00) merged 2 commits into
microsoft:mainfrom
kabel:bugfix/6916-email-visibility
May 8, 2025
Merged

Allow verified GitHub emails when none are private#6921
Alex Ross (alexr00) merged 2 commits into
microsoft:mainfrom
kabel:bugfix/6916-email-visibility

Conversation

@kabel

Copy link
Copy Markdown
Contributor

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.

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 Kevin Abel (kabel) left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Alex Ross (alexr00) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GitHub API is unclear, but I think this fix makes sense.

@vs-code-engineering vs-code-engineering Bot added this to the May 2025 milestone May 8, 2025
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) May 8, 2025 09:09
auto-merge was automatically disabled May 8, 2025 10:19

Pull request was closed

@alexr00

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) May 8, 2025 10:21
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) May 8, 2025 10:23
@alexr00
Alex Ross (alexr00) merged commit a7ad1a2 into microsoft:main May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants