A useful AI review of a test-automation pull request needs more than a generic request to check the code. GitHub Copilot code review can now read review instructions from the pull request’s head branch, use a dedicated setup workflow, and run behind separately configurable network controls. That gives QA teams a practical way to test their review policy before merging it.
This tutorial builds a narrow workflow for SDETs and automation testers. You will define test-review rules, make the runtime understand your project, request a review on a safe sample pull request, and validate every meaningful comment with deterministic evidence.
What changed in Copilot code review
GitHub’s July 17, 2026 changelog says supported custom instructions are now read from the head branch of the pull request. That includes copilot-instructions.md, scoped *.instructions.md files, agent skills, AGENTS.md, REVIEW.md, GEMINI.md, and CLAUDE.md. A team can therefore revise instructions in a feature branch, request Copilot review, and inspect the effect before those rules reach the default branch.
The same update adds a dedicated .github/workflows/copilot-code-review.yml file for runtime preparation. It can install dependencies, select repository-level runner behavior, configure tools, or perform other preparation required for the review. If the file does not exist, Copilot code review falls back to an existing copilot-setup-steps.yml file when one is available.
GitHub also says a firewall is enabled by default for Copilot code review and can be configured independently from the Copilot cloud agent. The exception is important: self-hosted runners do not currently support this firewall. Treat runner and network configuration as security controls, not as proof that review output is correct.
Example QA goal
Assume a Playwright pull request adds checkout tests. Your team wants Copilot to flag weak assertions, hidden retries, shared test data, hard-coded credentials, selectors tied to styling, and tests that cannot run independently. The review environment must install project dependencies so Copilot can understand scripts and supporting files.
Create a small training pull request with two intentional issues and one acceptable pattern. Use synthetic data only. The objective is not to prove that Copilot finds every defect; it is to measure whether the instructions produce useful, reproducible feedback without noisy false positives.
Step 1: Write observable QA review rules
Add focused instructions to the repository’s existing guidance file. Keep each rule tied to evidence a reviewer can verify. For example:
For test-automation changes:
- Flag assertions that do not verify the user-visible outcome.
- Flag fixed delays; recommend condition-based waits.
- Check that each test owns or safely isolates its data.
- Treat secrets in code, fixtures, logs, or screenshots as high risk.
- Ask for a failing-before and passing-after regression result for bug fixes.
- Do not claim a test passes unless CI or an attached run proves it.
Avoid vague instructions such as “review thoroughly.” Also avoid asking the model to approve a release. Copilot can identify a concern, but QA must reproduce it and apply the team’s actual acceptance criteria.
Step 2: Test instructions from the head branch
Create a feature branch that changes only the instructions and the small sample test. Open a draft pull request and request Copilot code review. Because the supported instructions are read from the head branch, you can revise wording and request another review without merging experimental policy into the default branch.
Record the branch commit, instruction file, review time, detected issues, missed seeded issues, and false positives. Change one instruction at a time so the result is interpretable. AI output can vary between runs, so do not tune a rule around a single successful comment.
Step 3: Prepare a dedicated review environment
Add .github/workflows/copilot-code-review.yml only when the reviewer needs project preparation. Keep setup minimal and reproducible: use the repository’s pinned runtime, install locked dependencies, and expose only commands required to understand or validate the test code.
name: Copilot code review setup
on:
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- run: npm ci
Treat this as an illustrative starting point and confirm the current GitHub schema before adopting it. Do not add deployment credentials, production access, destructive cleanup, or broad package installation. Pin or review third-party actions according to your supply-chain policy.
Step 4: Review runner and network boundaries
In repository or organization settings, confirm which runner executes Copilot code review and inspect its Internet-access policy. Allow only destinations genuinely required by setup. If dependencies can be restored through an approved internal registry, prefer that path over unrestricted access.
If your organization uses self-hosted runners, document GitHub’s current limitation that the Copilot code review firewall is not supported there. Compensate with runner-level egress controls, short-lived credentials, isolated environments, clean workspaces, and monitoring. Never assume the default firewall applies to a self-hosted job.
Step 5: Seed a measurable validation pull request
Build a harmless fixture containing known review targets. One test might assert only that a response exists while ignoring the business result. Another might reuse a mutable account across parallel tests. Include a stable test that uses a role-based locator and a web-first assertion so the reviewer has a valid comparison.
Define expected outcomes before requesting review. Mark each seeded issue with its risk, expected instruction, and deterministic reproduction. Do not hide real vulnerabilities or secrets in a training change. Synthetic examples are enough to evaluate review behavior.
Step 6: Triage each Copilot comment
For every comment, classify it as confirmed, useful but non-blocking, false positive, or not reproducible. Read the referenced code and nearby helpers. Then run the smallest relevant check. A selector warning should be tested against the rendered page; a data-isolation warning should be tested with parallel execution; a missing assertion should be demonstrated by a mutation or controlled failure.
Preserve the command, commit, environment, expected result, actual result, and artifact link. A persuasive explanation from Copilot is not evidence. Conversely, a missed seeded issue should become input for instruction improvement, not a reason to silently lower the test standard.
Step 7: Keep deterministic gates authoritative
Copilot review should complement required pull-request checks. Continue to run linting, unit and integration tests, browser automation, accessibility checks, security scanning, and any contract or performance gates required by the change. Keep branch protection and human approvals intact.
For a bug-fix test, require evidence that the test fails on the vulnerable revision and passes with the fix. For a new feature, connect assertions to acceptance criteria. If Copilot reports success without an accessible run or artifact, label the claim unverified.
QA rollout checklist
- Review instructions describe observable risks and expected evidence.
- Instruction changes are evaluated on a branch before merge.
- The sample pull request uses synthetic data and known-answer issues.
- Review setup installs only required, pinned dependencies.
- No production secrets or deployment permissions enter the review runtime.
- Runner type and Internet-access settings are documented.
- Self-hosted runner firewall limitations have compensating controls.
- Each Copilot finding is reproduced or rejected with evidence.
- Missed issues and false positives are tracked across several reviews.
- Deterministic CI gates and human merge approval remain mandatory.
Common mistakes
Do not merge experimental instructions before measuring their effect. Do not place every possible QA rule in one huge file; conflicting guidance creates noise. Do not give the review setup production credentials merely to make integration tests available. Do not treat network isolation as validation of model output. Finally, do not count the number of comments as review quality: one reproducible high-risk defect is more useful than many style observations.
Final takeaway
GitHub Copilot code review setup for QA is most useful when it is treated as a controlled review system. Test instructions on the pull-request branch, prepare only the environment the reviewer needs, constrain network and runner access, seed measurable examples, and verify findings with real checks. The AI review accelerates attention; deterministic tests and human judgment still decide whether a change is ready.
Official references
- Copilot code review: Customization and configurability improvements
- Responsible use of GitHub Copilot code review

