A repository team wants every Copilot-generated pull request to prove that the agent task contract was present before review. The contract file must define the agent inputs, expected outputs, and success criteria. The workflow must run automatically for pull requests into main and publish a small evidence artifact for reviewers. Which option completes the workflow?
name: validate-agent-contract
on:
(Missing value 1):
branches:
- main
permissions:
contents: read
pull-requests: read
jobs:
contract:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check agent task contract
(Missing value 2): |
test -f .github/agent-contract.md
grep -q "^Inputs:" .github/agent-contract.md
grep -q "^Outputs:" .github/agent-contract.md
grep -q "^Success criteria:" .github/agent-contract.md
- name: Upload validation evidence
(Missing value 3): actions/upload-artifact@v4
with:
name: agent-contract-evidence
path: .github/agent-contract.mdChoose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = pull_request Missing value 2 = run Missing value 3 = uses.
Why this is the answer
The correct option completes the GitHub Actions workflow to validate an agent task contract on pull requests. Missing value 1 = pullrequest: The prompt states the workflow must run for "pull requests into main," making pullrequest the appropriate event trigger. push would trigger on pushes to main, not pull requests. workflowdispatch is for manual triggers. pullrequesttarget has different security implications and is not needed here. Missing value 2 = run: The run keyword executes shell commands. The provided lines are shell commands (test, grep) designed to check for the contract file and its contents. uses is for calling actions, with is for action inputs, and env is for environment variables. Missing value 3 = uses: The uses keyword specifies an action to run. actions/upload-artifact@v4 is a standard GitHub Action for uploading artifacts. run would execute it as a shell command, which is incorrect for an action.
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