Here, we use GitHub Enterprise. We have an issue with people accidentally merging PRs during code freeze windows, which interferes with our in-house release tool. It would be nice if we could find a way to prevent this.
What I'm trying to do, is find a way to disable the big green Merge button on each repo belonging to our Organisation within GitHub while our release tool is running, and then reenable it afterwards. Ideally, this would be scripted, since we have control over our release tool.
How might this be accomplished?
There are numerous ways to do this; in the end, we went for changing the permissions (READ/WRITE/ADMIN) on (team, repository) combinations via the REST API.
That's not to say that webhooks, enabling/disabling branch restrictions, or the pre-merge would not work, however.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With