A repository uses this workflow to pass planning state from a first job to a second job. The team wants the second job to receive a short state summary and a file artifact without writing any repository changes. Evaluate the following statements. 1. The second job can read state_summary through the needs context. 2. The uploaded state.json file is available because the artifact is downloaded. 3. The workflow grants permissions for the agent to push repository changes.
name: share-agent-state
on:
workflow_dispatch:
inputs:
issue_number:
required: true
type: string
permissions:
contents: read
issues: read
jobs:
plan:
runs-on: ubuntu-latest
outputs:
state_summary: ${{ steps.capture.outputs.state_summary }}
steps:
- uses: actions/checkout@v4
- id: capture
run: |
mkdir -p .agent-state
./scripts/agent-plan \
--issue "${{ inputs.issue_number }}" \
--json .agent-state/state.json \
--summary .agent-state/summary.txt
echo "state_summary=$(cat .agent-state/summary.txt)" >> "$GITHUB_OUTPUT"
- uses: actions/upload-artifact@v4
with:
name: agent-state
path: .agent-state/state.json
execute:
runs-on: ubuntu-latest
needs: plan
steps:
- uses: actions/download-artifact@v4
with:
name: agent-state
- name: Continue agent
env:
STATE_SUMMARY: ${{ needs.plan.outputs.state_summary }}
run: |
./scripts/continue-agent \
--summary "$STATE_SUMMARY" \
--state state.jsonChoose 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 because the execute job explicitly accesses needs.plan.outputs.statesummary, which is how outputs from a previous job are consumed in GitHub Actions. Statement 2 is correct because the plan job uploads state.json as an artifact named agent-state, and the execute job subsequently downloads an artifact with the same name, making the file available in its working directory. Statement 3 is incorrect because the workflow's permissions block explicitly sets contents: read and issues: read, which does not grant permission to push changes. Pushing changes would require contents: write.
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