A repository owner configures guardrails for Copilot-generated pull requests. The goal is to let low-risk validation run automatically while requiring human review for changes that affect protected application areas. Evaluate the following statements. 1. Automated tests can run before a human approval decision. 2. Code owner review helps identify changes requiring domain judgment. 3. Passing tests means the Copilot PR no longer needs review.
name: validate-copilot-pr
on:
pull_request:
branches:
- main
permissions:
contents: read
pull-requests: read
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
Branch protection for main:
- Require a pull request before merging
- Require approvals: 1
- Require status checks: validate-copilot-pr / test
- Require review from Code Owners: enabled
CODEOWNERS:
.github/workflows/* @platform-owners
src/auth/* @security-reviewers
src/payments/* @payments-reviewersChoose an answer
Tap an option to check your answer.
Correct answer: 1=Yes 2=Yes 3=No.
Why this is the answer
Statement 1 is correct because the validate-copilot-pr workflow, which includes automated tests (npm test), is configured as a required status check for the main branch. This means these tests will execute automatically on every pull request targeting main before it can be merged, regardless of human approval. Statement 2 is correct because the CODEOWNERS file specifies different teams (@security-reviewers, @payments-reviewers) for sensitive application areas (src/auth/, src/payments/). This ensures that changes in these areas trigger reviews from individuals with specific domain expertise, which is crucial for identifying issues requiring human judgment. Statement 3 is incorrect. While passing tests are a necessary condition for merging, branch protection also requires at least one approval and Code Owner reviews. Therefore, passing tests alone does not eliminate the need for human review, especially for changes affecting protected areas.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed