A repository has a validation workflow for Copilot-generated pull requests. The team wants failures to be diagnosable from the workflow logs and artifacts without rerunning the agent blindly. A reviewer checks the workflow configuration.
name: validate-agent-pr
on:
pull_request:
branches:
- main
permissions:
contents: read
actions: read
checks: read
jobs:
validate:
runs-on: ubuntu-latest
env:
GIT_TRACE: "1"
GIT_CURL_VERBOSE: "1"
steps:
- uses: actions/checkout@v4
- name: Capture agent plan
run: |
mkdir -p diagnostics
test -f .github/copilot/implementation-plan.md && \
cp .github/copilot/implementation-plan.md diagnostics/implementation-plan.md || \
echo "plan not found" > diagnostics/implementation-plan.md
- name: Run validation tests
run: |
npm ci --verbose
npm test -- --json --outputFile=diagnostics/test-results.json
- name: Upload diagnostics
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: copilot-validation-diagnostics
path: diagnostics/
Evaluate the following statements.
1. Verbose Git and npm output can improve workflow log evidence.
2. The diagnostics artifact is uploaded after failed test runs.
3. The artifact upload makes failed required checks pass.Choose 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. The GITTRACE: "1" and GITCURLVERBOSE: "1" environment variables enable verbose Git output, and npm ci --verbose increases npm's logging detail. This provides more context in the workflow logs for diagnosing issues. Statement 2 is correct. The if: ${{ always() }} condition on the "Upload diagnostics" step ensures that the artifact is uploaded regardless of whether previous steps (like "Run validation tests") succeed or fail. Statement 3 is incorrect. Uploading an artifact does not change the status of a failed required check. If validation tests fail, the check will still fail, even if diagnostic artifacts are successfully uploaded.
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