A team creates an agent context bundle after reading the current issue, linked pull request, latest commit SHA, and failing check summary. A later job must consume the exact context bundle from the same workflow run. The team wants to avoid downloading a stale artifact from a previous run. Which option completes the workflow?
name: agent-context-refresh
on:
workflow_dispatch:
inputs:
issue_number:
required: true
type: string
permissions:
contents: read
issues: read
pull-requests: read
actions: read
jobs:
capture-context:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build context bundle
run: |
mkdir -p context
gh issue view "${{ inputs.issue_number }}" --json title,body,comments > context/issue.json
git rev-parse HEAD > context/head-sha.txt
- name: Upload context
(Missing value 1): actions/upload-artifact@v4
with:
name: (Missing value 2)
path: context/
consume-context:
needs: capture-context
runs-on: ubuntu-latest
steps:
- name: Download same-run context
(Missing value 3): actions/download-artifact@v4
with:
name: agent-context-${{ github.run_id }}
- name: Validate context SHA
run: cat head-sha.txtChoose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = uses Missing value 2 = agent-context-${{ github.run_id }} Missing value 3 = uses.
Why this is the answer
The correct answer ensures the artifact is uniquely identified and uploaded/downloaded using the standard GitHub Actions. Missing value 1: uses is correct because actions/upload-artifact@v4 is a GitHub Action that needs to be invoked with uses. run is for executing shell commands. Missing value 2: agent-context-${{ github.runid }} is correct. Using github.runid creates a unique artifact name for each workflow run. This prevents downloading a stale artifact from a previous run, as specified in the problem statement. agent-context-latest would be overwritten by subsequent runs, and agent-context-${{ github.sha }} would be unique per commit, not per workflow run, which might not guarantee uniqueness if the same commit is re-run. Missing value 3: uses is correct for the same reason as Missing value 1; actions/download-artifact@v4 is a GitHub Action. env is for setting environment variables.
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