cd /news/ai-tools/quiz-gate-answer-questions-before-me… · home › topics › ai-tools › article
[ARTICLE · art-146726] src=github.com ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Quiz Gate: Answer questions before merging code

A third-party GitHub Action called PR Comprehension Quiz Gate requires pull request authors to answer an AI-generated quiz about their own code changes before merging. The Action uses Copilot or Claude to write and grade the quiz, defaults to advisory mode with up to 3 questions and 3 attempts per PR revision, and can be set to required mode to block merges via the quiz-gate status check. The provider receives changed-file contents, diffs, and human PR comments but cannot run code or use tools, and the tool is not certified by GitHub.

read3 min views1 publishedOct 7, 2026
Quiz Gate: Answer questions before merging code
Image: Michielbdejong (auto-discovered)

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.

  1. Add a COPILOT_GITHUB_TOKEN repository secret using a fine-grained personal token withAccount permissions → Copilot Requests → Read and active Copilot access. See thetoken instructions .
  2. Copy the Copilot workflow to.github/workflows/quiz-gate.yml on your default branch. Set the Action reference tonot-a-feature/pr-quiz-gate@COMMIT_SHA with a tested SHA, and setmode: required . Keep the example's events, permissions, and concurrency settings.
  3. In your branch rules, require the quiz-gate status 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.

── more in #ai-tools 4 stories · sorted by recency
── more on @github 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/quiz-gate-answer-que…] indexed:0 read:3min 2026-10-07 · —