atomist-attic/spring-sdm

Github's email setting "Block command line pushes that expose my email" breaks `@atomist generate`

Closed this issue · 0 comments

Issue originated from atomist/automation-client#322

Created by @weisheme at 2018-07-24T12:25:24Z:

Note -- The full details on this bug can be found at https://atomist-community.slack.com/archives/C29DMA0R4/p1532430240000150 and have been confirmed by @cdupuis

How to reproduce:

  1. Go to your Github settings and enable:
    a) Keep my email address private
    b) Block command line pushes that expose my email
  2. Run @atomist generate kotlin spring or any other generate command.

Expected behavior:

A repository in my Github account that was created by Atomist bot.

Observed behavior:

A message by Atomist bot stating it's taking longer than usual. @cdupuis did some digging and found

remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
To https://github.com/weisheme/bootme.git
! [remote rejected] master -> master (push declined due to email privacy restrictions)

Possible solution:
Out of curiosity I did some digging, so not sure if this is helpful information at all. The following API call gives me the correct email. I tried using the Atomist Personal access token first, but it was missing the user:email scope and would return nothing.

curl -s -u "erik@*******.io:xxxxxxxxxxxxxxxxxxxxxxxx" https://api.github.com/user/public_emails | jq
[
  {
    "email": "7338386+weisheme@users.noreply.github.com",
    "primary": false,
    "verified": true,
    "visibility": null
  }
]

To which @cdupuis said:

Hmm, interesting. public_emails. We are using the emails endpoint.
That’s probably not correct.
Worth an issue in automation-client-ts.