Thanks to visit codestin.com
Credit goes to github.com

Skip to content

uiuc-cs448/uiuc-cs448.github.io

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Course staff GitHub notes

Various explanations, scripts, etc. for the GitHub-related uses of CS 448.

Course website

GitHub Pages with the Jekyll site generator and GitHub Flavored Markdown (GFM) processer.

Most markdown syntax renders as expected. However, some known exceptions:

  • LaTeX
  • Callouts (> [!NOTE], etc.)

Scripts

Short GitHub CLI commands to run locally* to workaround some of GH Classroom's dumb quirks.

*Trying to get these to be manually triggerable workflows on GH Actions. However, they use $GITHUB_TOKEN for authentication and I haven't set the right permissions. For now, run locally by copy-pasting the below commands and substituting/exporting any $ workflow variables. E.g. ORG=uiuc-cs448, STUDENT_TEAM=students, SOURCE_SLUG=lab-0

Onboard students to the organization

Students who accept a GH Classroom assignment only get access to their fork of it. Invite them to join a team to enable group tagging, permissions, etc. so you don't have to manage them individually. This also promotes them from an "Outside Collaborator" to an organization "Member" and doing this does not grant them access to other student's assignment repos (only repos that are explicitly set to be viewable by them / their team.

gh api "/orgs/$ORG/outside_collaborators" --paginate \
    | jq -r ".[].login" \
    | xargs -I {} \
        gh api --method PUT "/orgs/$ORG/teams/$STUDENT_TEAM/memberships/{}" -f "role=member"

(Actually) sync assignments

The "Sync assignments" button in GH Classroom opens a PR in each student's repo/fork but doesn't merge them. You can either merge all PRs or just sync the forks from $SOURCE (this must be a slug, e.g. lab-0), assuming they are non-conflicting.

Not thoroughly tested with merge conflicts, but these scripts should abort the conflicting repos.

Merge GH Classroom PRs

gh api /orgs/$ORG/repos --paginate \
    | jq -r ".[].name" \
    | xargs -I {} gh api "/repos/$ORG/{}/pulls" \
    | jq -r ".[] | select(.user.login == \"github-classroom[bot]\") .html_url" \
    | xargs -I {} gh pr merge "{}" -s

Sync forks

gh api orgs/$ORG/repos --paginate \
    | jq ".[].name | select(startswith(\"$SOURCE-\"))" \
    | xargs -I {} sh -c "echo \"Syncing fork {}:\" && gh repo sync \"$ORG/{}\" -s \"$ORG/$SOURCE\""

Leftover conflicts should error can't sync because there are diverging changes..., etc. You should be able to use "Sync assignments" afterwards to open PRs and manually resolve.

Download student repos (local only)

The GH Classroom CLI extension makes this easy via an interactive command.

gh classroom clone student-repos

By default, this clones all submitted (?) forks under $assignment into a dir $assignment-submissions.

About

website yay

Resources

Stars

Watchers

Forks

Contributors 2

  •  
  •