A Copilot coding agent opened a pull request that updates a test workflow. The team wants retry behaviour only around a flaky package download step, not around the full job. If all retry attempts fail, the workflow must still fail so the Copilot-generated PR is not treated as validated. Which option completes the workflow?
name: agent-pr-validation
on:
pull_request:
types:
- opened
- synchronize
- ready_for_review
permissions:
contents: read
pull-requests: read
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies with bounded retry
shell: bash
(Missing value 1): |
set -euo pipefail
for attempt in 1 2 3; do
echo "npm ci attempt ${attempt}"
if npm ci; then
exit 0
fi
sleep $((attempt * 10))
done
(Missing value 2)
- name: Run tests once
(Missing value 3): npm testChoose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = run Missing value 2 = exit 1 Missing value 3 = run.
Why this is the answer
The correct answer uses run for the script, exit 1 to ensure failure, and run for the test command. Missing value 1 = run: The run keyword is used to execute shell commands directly within a step. The provided code block is a multi-line bash script, making run the appropriate choice. uses is for GitHub Actions, with passes inputs to actions, and env sets environment variables. Missing value 2 = exit 1: After all retry attempts fail, exit 1 is crucial. This command explicitly signals to the workflow that the step has failed, causing the entire job to fail. This ensures that the Copilot-generated PR is not validated if the dependency installation ultimately fails, as per the requirement. continue-on-error: true would allow the workflow to proceed despite the failure, which is contrary to the requirement. exit 0 would incorrectly indicate success. continue is not a valid shell command in this context to control workflow execution. Missing value 3 = run: Similar to the first missing value, run is used here to execute the npm test shell command.
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