Get the ID of a Github-User

So basically if you wanted to add someone as a co-author, you'd need to create your commit-message as follows (I recommend to stick to the commit conventions):

<commit message>

Co-authored-by: NAME <email> # NOTE: (`NAME` is not the username!)

but if you don't know the email address of a user and the user account was created after July 18, 2017 then you can use their no-reply mail which has the following format:

ID+USERNAME@users.noreply.github.com

Neat, but how do we get ID? With an API-call! To be more specifique: api.github.com With the power of curl and jq that's just a oneliner:

curl https://api.github.com/users/<username> | jq ".id"

In my case it would be curl https://api.github.com/users/TornaxO7 | jq ".id" which returns 50843046.

So now in total it would look like this in the end:

Co-authored-by: TornaxO7 <50843046+TornaxO7@users.noreply.github.com>

That's it. Cheers!