Notify authors of Pull Request about failed builds



At this point only project subscribers are notified if build fails.

It’ll be great if person that submits pull request recieves automatic notification from Circle CI if branch they propose for merge fails.

As a side note, it’s also demanded feature in Travis CI system, but it looks they have hard time providing that ->

Hopefully it’ll not be the case with Circle CI :wink:


Would it be an option for you to send this notification manually during the build, for example by querying the GitHub API for the PR developer’s email and then sending them a note via an email API like Mailgun / Slack API or similar?


@alexey I think it’s totally great if there’s some hook that can easily be setup that would do that automatically

I didn’t thought about such solution before, but I think it’s possible to solve it that way, and should be good enough. Maybe such (or very similar hook) already exists?

Answering your question more directly: If by manual you mean: that some person prepares an email manually, then it hardly makes any improvement.


Manual as in your circle.yml has a call to the Mailgun API with all the correct parameters, of which some (like the message text) are hard-coded but others like PR submitter’s email address are collected during the build right before the API call. Does that make sense?


@alexey looks great, if it’s possible now, can you paste example of configuration I should input into circle.yml to obtain that?


I used this example from the Mailgun API docs:

    - test-command || touch failure.txt && exit 1
    - "if [ -f failure.txt ] ; then curl -s --user 'api:$MAILGUN_API_KEY' 
    -F from='Name <mailgun@YOUR_DOMAIN_NAME>' 
    -F subject='You broke the tests' 
    -F text='You broke the build on the branch $CIRCLE_BRANCH in the project

I am not yet sure about the committer’s name—you should be able to get it with GitHub’s API, as you have the project name, plus the $CIRCLE_SHA1 contains the revision being built.