Various explanations, scripts, etc. for the GitHub-related uses of CS 448.
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.)
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_TOKENfor 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
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"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.
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 "{}" -sgh 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.
The GH Classroom CLI extension makes this easy via an interactive command.
gh classroom clone student-reposBy default, this clones all submitted (?) forks under $assignment into a dir $assignment-submissions.