Help: With enough students, some idiot will always do a pull request with homework answers. CAN PULL REQUESTS BE DISABLED? #172031
Unanswered
hydrodog
asked this question in
Pull Requests
Replies: 2 comments 1 reply
-
No, you cannot completely disable pull requests on GitHub.What's NOT PossibleGitHub does not provide:
What You CAN Do Instead1. Auto-Close PRs with GitHub Actions# .github/workflows/close-prs.yml
name: Close Pull Requests
on:
pull_request:
types: [opened]
jobs:
close:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
script: |
github.rest.pulls.update({
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: context.issue.number,
state: 'closed'
});
2. Archive the RepositoryThis disables PRs and issues completelyOnly use if you want to make the repo read-only1. Navigate to Your Repository
2. Open Repository Settings3. Scroll down and you will find Danger Zone4. Click "Archive this repository" button5. Read the warning message carefully6. Type the exact repository name in the confirmation field7. Click "I understand the consequences, archive this repository"What Happens When You ArchiveThe repository becomes completely read-only:
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Can someone in support contact me and delete the pull request? I had this happen once before. A student just puts answers into my course repo. Archiving won't stop it after it's happened |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
General
Body
With apologies, I found discussion: 112013 that discusses this issue. Of course, no one did anything with it.
I put all my course materials out in github repos. I specifically do not use github classroom because I found the workflow to be prohibitive. So i have assignments in my course, and collect assignment in Canvas not git.
The fact that all my documentation is in github encourages students to learn how to use git, though I make individual files accessible from canvas via links, particularly for undergrad courses where programming is not the main point.
The problem is, there is always some genius that does a pull request with their HOMEWORK into my course repo. They aren't supposed to do this. It isn't even mentioned. That means there are files with answers embedded in pull requests in my course. Most people presumably don't notice, in fact I didn't notice until now that someone did it last semester. It's highly annoying.
I don't want pull requests. I don't want students able to do this at all. Worse, once they do this, I don't really know of any way to undo it. This is making git increasingly unusable for distributing my course materials. Can support come up with anything to stop this?
My suggestion: at the very least, a flag to disallow pull requests in a repo without permission of the owner. So a student can send a message requesting a pull request, and if they are allowed, then it can go. And perhaps owners of repos should be able to completely delete pull requests. Why not?
Beta Was this translation helpful? Give feedback.
All reactions