Actions
About #
Tags #
(2) A GitHub Action that asks PR authors to explain their changes before merging. Copilot or Claude writes the quiz and grades written answers. Multiple-choice answers are checked directly.
- Add a
COPILOT_GITHUB_TOKENrepository secret using a fine-grained personal token withAccount permissions → Copilot Requests → Read and active Copilot access. See thetoken instructions . - Copy the Copilot workflow to
.github/workflows/quiz-gate.ymlon your default branch. Set the Action reference tonot-a-feature/pr-quiz-gate@COMMIT_SHAwith a tested SHA, and setmode: required. Keep the example's events, permissions, and concurrency settings. - In your branch rules, require the
quiz-gatestatus from GitHub Actions and up-to-date checks. Choose the status rather than the workflow job, and leave bypass actors empty to enforce the rule for administrators too.
Prefer Claude? Use the Claude workflow with an
ANTHROPIC_API_KEY secret.
Or preview a setup PR with the installer:
uv run python install.py OWNER/REPO --action not-a-feature/pr-quiz-gate@COMMIT_SHA
Add --apply to create it. You'll need an authenticated gh CLI and the provider
token in your environment. Set branch rules separately.
The bot posts a quiz with code links and an answer form. Copy the form into your own PR comment, answer every question, and check Submit answers when ready.
You can also submit numbered answers:
/quiz answer CURRENT_QUIZ_ID
1: B
2: Explain the implementation and what you intend.
Only the PR author can answer. By default, passing takes a majority of correct answers, and any unresolved decisions still block merging even with a passing score. Results explain what needs work. New commits need a new quiz. To submit another attempt, post a new comment rather than editing a graded one.
| Command | What it does |
|---|---|
/quiz |
Start a missing or outdated quiz |
/quiz retry |
Get fresh questions after failing |
/quiz override REASON |
Override as a maintainer or admin, when enabled |
The default mode is advisory. Use required to block merging. Defaults allow
up to 3 questions and 3 attempts per PR revision, with maintainer overrides enabled.
See action.yml for models, score thresholds, and all other inputs.
Set a stable state-key to keep quizzes valid when rotating the provider token.
The provider receives changed-file contents, diffs, and human PR comments, but cannot run code or use tools. Answer keys are encrypted in bot comments and tied to the PR revision and author.
Binary files and changes over the context budget cause an error. Unchanged dependencies, review threads, and local agent sessions are excluded. Grading can be wrong, and authors can use AI to answer. Merge queues are unsupported. Bot-authored PRs need an override.
uv sync --locked
uv run python -m unittest discover -s tests -v
Tests mock the providers and GitHub APIs. See integration testing to test a branch or commit without a Marketplace release. Choose a commit with checkbox support, since older tags keep their original behavior.
PR Comprehension Quiz Gate is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.