fabric8io / fabric8-generator

a jboss forge add on for the fabric8 upstream and SaaS generator wizards
Apache License 2.0
1 stars 12 forks source link

Use getEmails2 #77

Open corinnekrych opened 7 years ago

corinnekrych commented 7 years ago

Following @aslakknutsen comment (close PR): In https://github.com/fabric8io/fabric8-generator/blob/master/src/main/java/io/fabric8/forge/generator/github/GitHubFacade.java#L236 It looks like only GHMyself.getEmail() is called. That will only fetch the email from the public profile if it's public. We do request user:email auth, and to get the private email we should call https://github.com/kohsuke/github-api/blob/master/src/main/java/org/kohsuke/github/GHMyself.java#L69 getEmails2() which calls the /user/emails endpoint.

Replace getEmail to use getEmails2 to return one email(whether or not available in public profile) for the user. Note we need to return one email, not a list of emails.