Skip to content

A utility for transferring multiple GitHub classroom repositories to a new owner.

License

Notifications You must be signed in to change notification settings

sekassel-research/github-classroom-tools

 
 

Repository files navigation

github-api-bulk-transfer

A utility for transferring multiple GitHub Classroom repositories to a new owner (user or organization).

This tool was derived from jdbean/github-api-bulk-transfer, but has a slightly different behaviour:

  • It combines repo names with contributors in the GitHub classroom format (prefix-username).
  • It deletes the student from the original collaborators. This is to avoid outside collaborator limits and ok for archival purposes.
  • It formats the output more nicely.

THIS UTILITY IS PROVIDED WITH NO WARRANTY OF ANY SORT. USE OF THIS SOFTWARE IS DEPENDENT ON AN UNSTABLE PREVIEW API AND ITS USE COULD RESULT IN LOSS OF DATA AMONG OTHER CONSEQUENCES. USE OF THIS SOFTWARE IS EXCLUSIVELY AT YOUR OWN RISK

Installation

  1. Clone this repository and open up a terminal in the root directory.
  2. Install bash, curl, & jq and any dependencies if you don't already have them installed.
  3. Create a GitHub Personal Access Token (Settings > Developer Settings > Personal Access Tokens > Generate new token). Select the full repo scope.
  4. Create an environment variable called GITHUB_TOKEN with the token you just created.
  5. Create a file named repos.txt in this directory.
  6. Create a file named students.txt in this directory.

Fetch Students

  1. Execute the program with the organization (Org), and the prefix (prefix).

    bash fetch_students.sh Org prefix
  2. (Optional) To write the list of students to students.txt directly, add > students.txt to end of the command.

Fetch Push Log (for a single repository)

Execute the program with the organization (Org), the repository (Repo), and (optionally) the start date (Date).

bash fetch_push_dates.sh Org Repo Date

Bulk Rename

  1. Copy the list of GitHub usernames of your students into students.txt. Example:

    alice
    bob
    charlie
    ...
    
  2. Execute the program with the old prefix including organization (Org/OldPrefix), and the new prefix (NewPrefix): bash bulk_rename_repos.sh Org/OldPrefix NewPrefix

Bulk Transfer

  1. Copy the list of all of your assignments prefixes and paste them into repos.txt. Put each prefix on a new line and make sure to include the repo owner. Example:

    org/assignment-1
    org/assignment-2
    ...
    
  2. Copy the list of GitHub usernames of your students into students.txt. Example:

    alice
    bob
    charlie
    ...
    
  3. Execute the program with the name of the new owner (NewOwner): bash bulk_transfer_repos.sh NewOwner

License

All work in this repository is made available under the terms of the AGPLv3 License, a copy of which is provided in the file called License. Copyright J.D. Bean 2019

About

A utility for transferring multiple GitHub classroom repositories to a new owner.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 86.5%
  • JavaScript 13.5%