Skip to content

cs160-berkeley/github-scripts

Repository files navigation

Scripts for GitHub Organization Management

This repository contains the bash and Perl scripts for managing an organization and repositories on GitHub used for CS160 Spring 2016, UC Berkeley.

Prerequisite

  • Visit GitHub Education to request an advanced organization plan.
    • For the Spring 2016 class, we received a diamond plan that allows up to 300 private repos.
    • Given a class of 200+ students, our strategy was to release assignments one by one (i.e., once done grading, we make all graded private repos public. We then release the next assignment with private repos.)
  • Add GSIs as owners.
  • Follow GitHub Help for Creating an access token for command-line use
  • Set up your bash or Perl environment. Perlbrew is a handy perl installation management tool on Mac.
  • For each assignment, consider using [GitHub Classroom] (https://classroom.github.com/) to set up a link that students can create individual repos based on an assigned template.

Adding members to an organization

invite_user.sh retrieves a list of GitHub usernames from a text file and adds users to an organization. Added members will need to accept the invitation via email notification sent by GitHub or visit the organization page (e.g., https://github.com/cs160-sp16).

./invite_user.sh your_github_token your_org_id filename_of_student_list

Be sure to change the script access permission via chmod a+x

Repo management

Note: This requires having a perl module that reads json content.

  • tag_repos.pl tags target private repos to label the submitted version.
  • set_public.pl changes the visibility of target private repos to public.
./tag_repos.pl your_github_token your_org_id

Team management

Creating new teams, adding team members, and creating team repos: This requires csv files that include team info. See the file headers for more info.

  • create-team-and-add-members.pl creates new teams and adds team members.
  • create-repo-for-team.pl creates a team repo for each team.

Reference

GitHub API GitHub Education GitHub Classroom

Contact

Peggy Chi (peggychi@cs.berkeley.edu)

Acknowledgments

Senpo Hu for helping build up the scripts

About

Repo and team management for class assignments

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published