GH-200 - Author and manage workflows - Section 1.8

Produce job summaries with GITHUB_STEP_SUMMARY, add workflow status badges and environment protections, and reuse YAML with anchors and aliases.

Write structured Markdown to GITHUB_STEP_SUMMARY to produce per-run job summaries, and embed workflow status badges in repository documentation. Configure environment protections and reuse repeated YAML blocks with anchors and aliases.

GITHUB_STEP_SUMMARYstatus badgesenvironment protectionsYAML anchors

Practice question for this objective

Free sampleAuthor and manage workflowsmedium

A workflow step computes a Markdown test report and must publish it on the run's summary page so reviewers see a formatted table without opening the raw log. The step writes the Markdown by appending it to a file path exposed through an environment variable. Which variable should the step append the Markdown to?

steps:
  - name: Publish report
    run: echo "## Results" >> "$<VARIABLE>"
  • AAppend it to GITHUB_OUTPUT, because Markdown written to that file is rendered on the run summary page once the step finishes.
  • BAppend it to GITHUB_ENV, because values written to that file are collected and displayed as the formatted summary for the run.
  • CAppend it to GITHUB_STEP_SUMMARY, because Markdown written to that file path is rendered on the run summary page for the job. Correct
  • DAppend it to GITHUB_PATH, because content added to that file is collected by the runner and shown as the job summary report.
Write Markdown to the GITHUB_STEP_SUMMARY file to render a formatted job summary on the run page. GitHub Actions watches the file referenced by the GITHUB_STEP_SUMMARY environment variable, and any Markdown appended to it is rendered on the workflow run summary page for that job. The other runner files serve different purposes: GITHUB_OUTPUT records step outputs, GITHUB_ENV sets environment variables, and GITHUB_PATH adds entries to the PATH, so none of them produce a rendered summary.

Why A is wrong: Tempting because GITHUB_OUTPUT is also an appended file, but it stores key-value step outputs for later steps to read and does not render Markdown on the run summary page.

Why B is wrong: Tempting because GITHUB_ENV is an appended file too, but it sets environment variables for later steps in the job and never produces Markdown on the run summary page.

Why C is correct: Markdown appended to the file at GITHUB_STEP_SUMMARY is rendered on the run summary page for the job, giving reviewers a formatted table without reading raw logs.

Why D is wrong: Tempting because GITHUB_PATH is also a runner file you append to, but it prepends directories to the system PATH for later steps and renders nothing on the summary page.

See more GH-200 practice questions, answers explained.

More in this domain

Back to all Author and manage workflows objectives, or the GH-200 cert hub.

Examworthy is not affiliated with or endorsed by GitHub. Original, blueprint-aligned practice material only.