GitHub App to stop pushes

I would like to build a GitHub App that allows a QA team member to disable temporarily the ability of developers to push to a GitHub branch (e.g. Stage). How do I disable the ability to push with a GitHub App? I have read about the pre-push event, but is that the event I want to use?

Interesting question.

You could potentially have the GitHub App update the branch protection settings for the Stage branch to have a more restrictive set of people who are allowed to push to it. But Git hooks typically would not be the way to go.

I hope that helps! Let us know if you have more quesitons.

Make that branch a protected branch and then have your app post a status check on all pull requests to that branch. Then your GitHub App would post a passing status check or a failing status check on pull requests to that branch, depending on whatever behavior your programmed into your app.