Search code examples
githubwebhooksconcourse

Showing ConcourseCI build status on github pull requests


I currently have a fully functioning pipeline that's been deployed to a concourse server. It will receive push events from a github repo, and run the pipeline as such.

I have a webhook that's also able to talk from github to the concourseCI server.

It looks something like this: https://concourse.myorganization.app/api/v1/teams/my_team/pipelines/git-repo-name/resources/git-repo-pull-requests/check/webhook?webhook_token=some_token

I have it dropped into the settings of the Github repo as a webhook, and it's returning 2xx after each push to a pull request. How can I get the status of the build in ConcourseCI to show up on the pull request like this


Solution

  • GitHub build status is independent from the webhook: the webhook goes from GitHub to Concourse, while here we need the opposite direction: from Concourse to GitHub. Also, it cannot be synchronous, since the webhook triggers a build that takes time to complete.

    You need to signal the build status with a Concourse resource. The one I prefer (since I wrote it :-) is https://github.com/Pix4D/cogito.