bluzi / travis-buddy

:rocket: Seamless integration between TravisCI and GitHub
https://www.travisbuddy.com/
MIT License
252 stars 20 forks source link

Is it possible to get the username of the commit? #140

Open Rylon opened 5 years ago

Rylon commented 5 years ago

Hi,

We'd like to be able to notify the specific user who created the commit, rather than the author of the original Pull Request, so something like Hi @{{commitUsername}}, instead of Hi @{{pullRequestAuthor}},. This is so collaborators on a pull request get notified by the bot if they break the build, rather than it notifying the original author of the PR who may be a different person.

Is that something that might be possible? I don't see it in the payload we receive from Travis, so I guess an additional API call is needed in the pipeline?

Thanks!

bluzi commented 5 years ago

Hey, we're already doing the extra hop to GitHub to get the username, actually, pullRequestAuthor is the username and author is sometimes and username and sometimes the full name (depends on what TravisCI sends us)

bluzi commented 5 years ago

Ref: https://github.com/bluzi/travis-buddy/blob/e554b1ff59731bcfbf7d1b6adea7c0259d7c10f1/pipes/parse-travis-payload.pipe.js#L52

Rylon commented 5 years ago

Aha thanks for the clarification @bluzi in my case I wanted to make sure it was always the author of the commit, so author seemed like a logical thing to try, but when I updated the message templates to try it, I kept getting the full name in the format "Firstname Surname", so the rendered form would be @Firstname Surname which obviously didn't notify the right person. 😂