6

We would like to use mandatory code reviews on pull requests in GitHub Enterprise 2.10 (using the "Require pull request reviews before merging" feature in the repository protected branch settings).

However, when we enable this feature, Maven release builds fail, since the release plugin tries to push the new SNAPSHOT version to the repository using the credentials of the user that runs the TeamCity release build.

Has anyone come up with an approach that works for this? Our requirements are:

  • Require code reviews for normal commits/pull requests
  • Allow automated release builds to commit the updated POM versions
  • Have all commits done by specific non-shared user accounts
Richard Neish
  • 8,414
  • 4
  • 39
  • 69
  • 1
    Did you find a solution for this? I just ran into the same problem. It's a pretty standard workflow and readily possible with Atlassian's BitBucket, so I would imagine GitHub must have some kind of hook for this as well? – raner Dec 20 '17 at 02:03
  • I'm not sure you can achieve all the requirements given that the release plugin uses standard git commands. We have this problem, and the only way out for us is to give the CI account the GH admin role, in order to skip branch protection. – ashley Nov 04 '20 at 11:08

1 Answers1

2

I found this answer on a related question: https://stackoverflow.com/a/47006088

My impression is that if you leave the "include administrators" checkbox unchecked, then you can use a repository owner with the release plugin. The trade off is you would then rely on discipline from your developers who are repository owners to not skip the review process.

suthsc
  • 21
  • 5