Skip to content
This repository has been archived by the owner on Jan 29, 2021. It is now read-only.

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

Open
Rylon opened this issue Nov 29, 2018 · 3 comments
Open

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

Rylon opened this issue Nov 29, 2018 · 3 comments

Comments

@Rylon
Copy link

Rylon commented Nov 29, 2018

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
Copy link
Owner

bluzi commented Nov 29, 2018

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
Copy link
Owner

bluzi commented Nov 29, 2018

Ref:

const getPullRequestAuthor = async (

@Rylon
Copy link
Author

Rylon commented Dec 4, 2018

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. 😂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants