A repository uses an agent workflow with two jobs. The first job reads issue context and produces a compact JSON state file that includes the issue number, selected files, test command, and risk notes. The second job must receive the state path through a job output and then use the uploaded state artifact during execution. Which option completes the workflow?
name: agent-state-handoff
on:
workflow_dispatch:
inputs:
issue_number:
required: true
type: string
permissions:
contents: read
issues: read
jobs:
plan:
runs-on: ubuntu-latest
outputs:
state_path: ${{ steps.state.outputs.state_path }}
steps:
- uses: actions/checkout@v4
- id: state
name: Build agent state
run: |
mkdir -p .agent-state
./scripts/build-state \
--issue "${{ inputs.issue_number }}" \
--output .agent-state/state.json
echo "state_path=.agent-state/state.json" >> "(Missing value 1)"
- name: Upload state artifact
uses: actions/upload-artifact@v4
with:
name: agent-state
path: ${{ steps.state.outputs.state_path }}
execute:
runs-on: ubuntu-latest
needs: (Missing value 2)
steps:
- uses: actions/checkout@v4
- name: Download state artifact
uses: actions/download-artifact@v4
with:
name: (Missing value 3)
- name: Run agent with shared state
run: |
./scripts/run-agent \
--state "${{ needs.plan.outputs.state_path }}"Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = $GITHUB_OUTPUT Missing value 2 = plan Missing value 3 = agent-state.
Why this is the answer
The correct option completes the workflow by correctly handling job outputs, job dependencies, and artifact names. 1. $GITHUBOUTPUT: This is the correct environment file to write step outputs to. The line echo "statepath=.agent-state/state.json" $GITHUBOUTPUT correctly sets the statepath output for the state step. 2. plan: The execute job needs to run after the plan job has completed and produced its output and artifact. Therefore, needs: plan correctly establishes this dependency. 3. agent-state: This is the exact name given to the artifact when it was uploaded in the plan job (name: agent-state). To download the correct artifact, the download-artifact action must use the same name. Incorrect options fail because they use the wrong environment file for step outputs, specify incorrect job dependencies, or use the wrong artifact name for downloading.
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