Skip to content
Latchkey

GitHub Actions "Unable to process file command 'output' ... invalid format" in CI

Writing name=value to $GITHUB_OUTPUT only works for single-line values. A value containing a newline must use the heredoc form with a unique delimiter, or the runner rejects the file command as invalid format.

What this error means

A step fails with "Error: Unable to process file command 'output' successfully." and "Invalid format '<line>'" when it writes a multiline value to GITHUB_OUTPUT.

GitHub Actions
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'line two of the value'

Common causes

A multiline value written as name=value

The newline after the first line is read as the start of a new, malformed command line.

A delimiter that appears in the value

A heredoc whose end marker also occurs inside the value terminates early and corrupts the format.

How to fix it

Use the heredoc delimiter form

  1. Pick a delimiter that does not occur in the value (e.g. a random string).
  2. Write name<<DELIM, the value, then DELIM on its own line.
  3. Re-run.
bash
{
  echo "notes<<EOF"
  echo "line one"
  echo "line two"
  echo "EOF"
} >> "$GITHUB_OUTPUT"

Use a random, unique delimiter

Generate a delimiter so it can never collide with the content.

bash
EOF=$(openssl rand -hex 8)
echo "notes<<$EOF" >> "$GITHUB_OUTPUT"
cat notes.txt >> "$GITHUB_OUTPUT"
echo "$EOF" >> "$GITHUB_OUTPUT"

How to prevent it

  • Always use the heredoc form for multiline outputs.
  • Choose a delimiter that cannot appear in the value.
  • Avoid set-output, which is deprecated.

Frequently asked questions

What causes ""Unable to process file command 'output'""?
The newline after the first line is read as the start of a new, malformed command line.
How do I fix "Unable to process file command 'output'"?
Use the heredoc delimiter form

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card