- Download the lastest pre-built binary (if running as an end user) or install Deno (if running as a developer)
- Ensure the GitHub organization allows for Fine-Grained Personal Access Tokens
- Create a GitHub Fine-Grained Personal Access Token for the organization
- Token name:
GitHub Classroom Fix
- Expiration: next day (or as desired, but no longer than necessary)
- Resource owner: [organization name]
- Repository access:
All repositories
- Repository permissions
- Administration:
Read and write
- Metadata:
Read-only
- Administration:
- Organization permissions (none)
- Token name:
CLI Option | Environment Variable | Description | Required |
---|---|---|---|
--github-token |
GITHUB_TOKEN |
GitHub Fine-Grained Personal Access Token | Yes |
--organization-name |
ORGANIZATION_NAME |
GitHub organization name | Yes |
- Run the tool
- Pre-built binary:
./dist/<tool name>.<target platform triple>
(e.g.:./dist/fix-collaborators.x86_64-unknown-linux-gnu
) - With Deno:
deno run --allow-env --allow-net --allow-read src/tools/<tool name>.ts
(e.g.:deno run --allow-env --allow-net src/tools/fix-collaborators.ts
)
- Pre-built binary:
This tool ensures that every student is a collaborator on their own repository. On September 17, 2024, GitHub Classroom experienced a bug where students were not added as collaborators to their own repositories. This tool fixes that issue.
CLI Option | Environment Variable | Description | Required |
---|---|---|---|
--repository-username-pattern |
REPOSITORY_USERNAME_PATTERN |
Repository username extraction pattern (This should be a JavaScript regular expression pattern with exactly one capturing group that captures the student username) | Yes |
--repository-permission |
REPOSITORY_PERMISSION |
Desired repository permission (This should be one of the following values: pull , triage , push , maintain , admin ) |
Yes |