GitHub Actions: Expressions, Contexts, Variables, and Outputs/Write a multiline value to GITHUB_OUTPUT

Preserve newlines in an output variable.

Section: Env files, step outputs, and job outputs

Write a multiline value to GITHUB_OUTPUT

bash
bash
{
  echo 'notes<<EOF'
  cat CHANGELOG.md
  echo 'EOF'
} >> "$GITHUB_OUTPUT"
Explanation

Use the heredoc-like delimiter format for multiline values in environment files.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Env files, step outputs, and job outputs
Set a step output
Append to `GITHUB_OUTPUT` to expose a named output.
OpenIn sheetbashsame section
Set an environment variable for later steps
Append to `GITHUB_ENV` to persist a variable in the current job.
OpenIn sheetbashsame section
Read a previous step output
Use the `steps` context to consume a step output.
OpenIn sheetyamlsame section
Promote a step output to a job output
Pass values between jobs through `needs`.
OpenIn sheetyamlsame section
Use a context value in a step
Read metadata from the current workflow run.
Use repository or organization variables
Read configuration values from the `vars` context.