Add validation checks for GitHub pull requests

后端 未结 1 1013
[愿得一人]
[愿得一人] 2021-01-21 10:06

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 wi

1条回答
  •  盖世英雄少女心
    2021-01-21 10:44

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

    0 讨论(0)
提交回复
热议问题