A Copilot-created draft pull request adds a workflow that comments on the PR when validation fails. The required check fails before the error summary is posted. Which option best explains the failure? Select one answer.
Workflow: agent-error-handler
Event: pull_request
Actor: github-copilot[bot]
Job: failure-summary
Run npm test
FAIL tests/integration/payment.test.js
Error: Process completed with exit code 1.
Run gh pr comment 84 --body-file diagnostics/failure-summary.md
gh: Resource not accessible by integration
HTTP 403
permissions:
contents: read
pull-requests: readChoose an answer
Tap an option to check your answer.
Correct answer: The token lacks permission to write comments.
Why this is the answer
The correct answer is that the token lacks permission to write comments. The error message "gh: Resource not accessible by integration HTTP 403" explicitly indicates a permission issue. The github-copilot[bot] actor, like other GitHub Apps, operates with specific permissions. The permissions block in the workflow only grants contents: read and pull-requests: read, but writing comments requires pull-requests: write. Without this write permission, the gh pr comment command fails. The test failure did not cancel all later steps; the workflow continued to attempt the gh pr comment step, which then failed due to permissions. The workflow used the pullrequest event, which is appropriate for this scenario, so the branch filter is not the issue. The artifact directory being missing locally is irrelevant to a GitHub Actions workflow attempting to post a comment via the gh CLI.
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