This project contains a Python script designed to automate the updating process of student repositories in GitHub Classroom. The primary goal of this script is to ensure all student repositories have the proper grading files and to send a commit to re-trigger the autograder. This is particularly useful for educators who need to distribute grading updates or trigger autograding across multiple student repositories efficiently.
- Python 3.x
- Git and GitHub CLI installed and configured on your machine with the classroom extention found here
- Access to the GitHub Classroom repositories with sufficient permissions to clone and push changes
- Clone this repository to your local machine.
- Ensure you have a directory named
template
in the same directory as the script. Place any files or folders you want to copy into each student repository inside thistemplate
directory.
To run the script, use the following command in the terminal:
python grader.py [assignment_number]
- Clones the student repositories from GitHub Classroom into a directory.
- Copies files from the template directory into each cloned repository, overwriting any existing files with the same name.
- The template file provided in this here is for grading the following repo
- Commits the changes in each repository. If there are no new changes, an empty commit is made. This commit serves to re-trigger the autograder.
- Pushes the commits to the corresponding repositories on GitHub.
- This script will overwrite files in the student repositories if they have the same name as those in the template directory. Use with caution.
- Ensure you have the necessary permissions before attempting to push changes to student repositories.