Forbid Merge on Students ' Pull Request

Is there a way to forbid students’ to merge their pull requests on the Individual assignment repo?

I want to review their submissions before I make myself the merge or I decide to send back the assigment with some notes.


Hi @pekechis

You can protect a branch and enable the rule “Require pull request reviews before merging”.

However, the downside is that this cannot be done from the GitHub Classroom dashboard. By contrast, you have to visit each student’s repository and proceed accordingly, which might be quite annoying if done manually.

A viable workaround is to use GitHub API that allows you to obtain the same result programmatically.

In that case:

  • Do I have to create the branch on the repo previously?
  • Wouldn’t be the same to reopen the PR?

In case I decide yo go with a group assignment…would I have the same problem?

Thanks Ugo.

You ought to protect the branch master in each student repository so that any PR will need to be approved by admins. The branch master is typically created automatically by GitHub Classroom when the student clicks on the invitation link.

You can proceed with protecting master also now, in the middle of the assignment.

Group assignments are not different from individual assignments in this respect as all this is concerned with how GitHub works under the hood.

Hope this helps.

© 2017 GitHub, Inc.
with by
GitHub Education