A team wants Copilot-generated pull requests to run fast validation automatically. Human approval should be required only when the PR touches high-risk paths such as .github/workflows/**, src/auth/**, or src/payments/**. The workflow should run on pull requests to main and only read repository contents. Which option completes the workflow?
name: risk-scoped-agent-review
on:
(Missing value 1):
branches:
- main
permissions:
contents: (Missing value 2)
pull-requests: read
jobs:
classify-risk:
runs-on: ubuntu-latest
outputs:
high_risk: ${{ steps.paths.outputs.high_risk }}
steps:
- uses: actions/checkout@v4
- id: paths
uses: dorny/paths-filter@v3
with:
filters: |
high_risk:
- '.github/workflows/**'
- 'src/auth/**'
- 'src/payments/**'
require-review:
needs: classify-risk
if: (Missing value 3)
runs-on: ubuntu-latest
steps:
- run: echo "High-risk Copilot change requires maintainer review."Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = pull_request Missing value 2 = read Missing value 3 = needs.classify-risk.outputs.high_risk == 'true'.
Why this is the answer
The correct option configures the workflow to trigger on pullrequest events, which is necessary for evaluating changes before merging to main. Setting permissions.contents to read adheres to the principle of least privilege, as the workflow only needs to read repository files, not modify them. Finally, needs.classify-risk.outputs.highrisk == 'true' correctly uses the output from the classify-risk job to conditionally execute the require-review job, ensuring human approval is only requested for high-risk changes. The incorrect options fail for several reasons: push triggers after changes are merged, workflowdispatch is manual, and schedule is time-based, none of which fit the requirement for pull request validation. permissions.contents: write grants unnecessary permissions. always() and failure() do not implement the conditional logic based on risk classification. github.actor == 'github-copilot[bot]' would only trigger for Copilot-generated PRs, not all PRs that might touch high-risk paths.
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