A team wants every Copilot-generated pull request validation run to preserve the agent plan, test logs, and trace output as workflow artifacts, even when tests fail. The workflow should run for pull requests to main and keep enough evidence for later root-cause analysis. Which option completes the workflow?
name: validate-agent-output
on:
(Missing value 1):
branches:
- main
permissions:
contents: read
actions: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run tests with trace output
run: |
mkdir -p diagnostics
npm ci
npm test -- --reporter=junit --outputFile=diagnostics/junit.xml
cp .github/copilot/implementation-plan.md diagnostics/implementation-plan.md || true
- name: Upload diagnostics
if: (Missing value 2)
uses: (Missing value 3)
with:
name: agent-root-cause-evidence
path: diagnostics/Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = pull_request Missing value 2 = ${{ always() }} Missing value 3 = actions/upload-artifact@v4.
Why this is the answer
The correct answer ensures the workflow runs for pull requests and consistently uploads diagnostic artifacts. Missing value 1 = pullrequest triggers the workflow on pull request events to the main branch, as specified. Missing value 2 = ${{ always() }} is crucial because it ensures the "Upload diagnostics" step runs regardless of whether previous steps (like tests) succeeded or failed. This guarantees artifacts are preserved even for failed runs, which is essential for root-cause analysis. Missing value 3 = actions/upload-artifact@v4 is the standard GitHub Action for uploading workflow artifacts. Incorrect options: push would trigger on pushes, not pull requests. success() would prevent uploads on test failures. actions/cache@v4 is for caching dependencies, not uploading artifacts. workflowdispatch requires manual triggering. cancelled() would only run if the workflow was canceled. actions/download-artifact@v4 is for downloading, not uploading. pullrequesttarget has different security implications and is not needed here. github.actor == 'github-copilot[bot]' would restrict uploads to Copilot's bot account, which is not the requirement. actions/upload-pages-artifact@v3 is for GitHub Pages, not general artifact storage.
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