Skip to content
Latchkey

GitHub Actions multiline output to GITHUB_OUTPUT without a delimiter

Step outputs go to the GITHUB_OUTPUT file one entry per line. A multiline value written as "name=value" breaks the parser; multiline outputs need the heredoc delimiter form.

What this error means

A step that sets a multiline output fails with an invalid-format error, or downstream steps see an empty or truncated output.

github-actions
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'line 2 of changelog'

Common causes

NAME=value used for multiline content

A value spanning multiple lines was written with "echo name=$value >> GITHUB_OUTPUT", which only supports single-line values.

How to fix it

Write the output with a heredoc delimiter

  1. Use NAME<<DELIM ... DELIM to write multiline outputs.
  2. Reference the output later via steps.<id>.outputs.<name>.
  3. Re-run.
.github/workflows/ci.yml
- id: notes
  run: |
    {
      echo 'changelog<<EOF'
      git log --oneline -n 5
      echo 'EOF'
    } >> "${GITHUB_OUTPUT}"
- run: echo "${{ steps.notes.outputs.changelog }}"

How to prevent it

  • Use the heredoc form for any output that can be multiline.
  • Give each multiline output a unique delimiter to avoid collisions.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →