A platform team wants every agent validation workflow to leave a durable Markdown summary on the workflow run page and upload the detailed decision log as a retained artifact. The workflow should run for pull requests into main. Which option completes the workflow?
name: capture-agent-state
on:
(Missing value 1):
branches:
- main
permissions:
contents: read
jobs:
summarize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate decision log
run: |
mkdir -p agent-state
./scripts/validate-agent-output.sh > agent-state/decision-log.md
- name: Add workflow summary
run: |
echo "## Agent validation summary" >> (Missing value 2)
cat agent-state/decision-log.md >> (Missing value 2)
- name: Upload durable decision log
uses: (Missing value 3)
with:
name: agent-decision-log
path: agent-state/decision-log.md
retention-days: 30Choose an answer
Tap an option to check your answer.
Correct answer: Missing value 1 = pull_request Missing value 2 = $GITHUB_STEP_SUMMARY Missing value 3 = actions/upload-artifact@v4.
Why this is the answer
The correct option triggers the workflow on pullrequest events targeting the main branch, as specified by the requirement "run for pull requests into main." $GITHUBSTEPSUMMARY is the correct environment variable for appending Markdown content to the workflow run summary page, fulfilling the "durable Markdown summary" requirement. actions/upload-artifact@v4 is the standard GitHub Action for uploading workflow artifacts, which is necessary to "upload the detailed decision log as a retained artifact." Incorrect options: workflowdispatch triggers manually, not on pull requests. $GITHUBENV sets environment variables, not the workflow summary. actions/download-artifact@v4 downloads, not uploads. push triggers on pushes, not specifically pull requests. $GITHUBOUTPUT sets job outputs, not the workflow summary. actions/cache@v4 is for caching, not artifact retention. schedule triggers at scheduled times, not on pull requests. $GITHUBPATH modifies the PATH environment variable, not the workflow summary. actions/checkout@v4 checks out code, not uploads artifacts.
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