Add validation checks for GitHub pull requests
Asked Answered
R

1

3

I'd like to add a validation check on every PR for the master branch to my GitHub repo (for integration with our Bamboo CI).

That is, each push to the master branch will trigger a Bamboo build, which must pass prior to that push being ready to merge.

On the repo's Settings page under "Branch protection for master"-->"Require status checks to pass before merging"

I don't see a status check option for the Bamboo build. How can I add it?

I've already added the Bamboo service in the Webhooks & Services section of the repo settings, and tested that the service can properly trigger a Bamboo build with the "Test service" button.

Repugnant answered 5/7, 2016 at 16:56 Comment(0)
H
3

There is an old Bamboo plugin GitHub Status. You can try to install it.

If that doesn't help, there is always an option to add a couple of custom scripts which will post statuses via GitHub Status API.

In fact, it's very simple, all you need is just to make a POST request to your repo:

POST /repos/:owner/:repo/statuses/:sha
{
  "state": "success",
  "target_url": "https://example.com/build/status",
  "description": "The build succeeded!",
  "context": "continuous-integration/jenkins"
}

where :sha is a commit which triggered the build. It's stored in environment variable {bamboo.planRepository.revision}.

Hime answered 6/7, 2016 at 9:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.