A team uses Copilot coding agent for implementation work, but wants repository controls to prevent unchecked merges. Review the workflow and repository rule summary. Evaluate the following statements. 1. The workflow can validate Copilot-created PRs that change src/** and target main. 2. The path filter prevents Copilot from modifying files outside src/**. 3. The repository rules keep merge approval separate from Copilot’s code generation.
name: validate-agent-pr
on:
pull_request:
branches:
- main
paths:
- "src/**"
- ".github/workflows/**"
permissions:
contents: read
pull-requests: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
Repository rule summary
Target branch: main
Required status checks:
- validate-agent-pr / validate
Required reviews:
- 1 approving review
Require review from Code Owners: enabled
Allow auto-merge: disabledChoose an answer
Tap an option to check your answer.
Correct answer: 1=Yes 2=No 3=Yes.
Why this is the answer
Statement 1 is correct because the workflow is triggered on pull requests targeting the main branch and includes a path filter for src/, meaning it will run for PRs that modify files within that directory. Statement 2 is incorrect. The path filter paths: - "src/" in the workflow only determines when the workflow runs; it does not prevent Copilot or any other user from creating PRs that modify files outside src/. Statement 3 is correct. The repository rules explicitly require "1 approving review" and "Require review from Code Owners," which are separate human-driven steps from Copilot's code generation, ensuring human oversight before merging.
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