Unable to process file command 'output' successfully in GitHub Actions
Fixes 'Unable to process file command 'output' successfully' when writing step outputs. Use when $GITHUB_OUTPUT writes fail with Invalid format. Not for $GITHUB_ENV issues.
TL;DR: Write multi-line values with the heredoc form (name<<EOF on its own lines) instead of echo "name=$value"; every line appended to $GITHUBOUTPUT must be name=value on a single line. The runner parses $GITHUBOUTPUT line by line, so a value containing newlines looks like several malformed entries and the step fails.
Unable to process file command 'output' successfullyThe fix
- Find the line that writes the multi-line value, e.g. echo "report=$REPORT" >> "$GITHUB_OUTPUT".
Expected: You see the plain key [your value] write.
- Replace it with the heredoc form, delimiter alone on its line:
echo "report<[EOF"]> "$GITHUB_OUTPUT"
echo "$REPORT" >> "$GITHUB_OUTPUT"
echo "EOF" >> "$GITHUB_OUTPUT"Expected: The step completes; downstream steps read the full multi-line value.
- Use a delimiter that cannot appear in the value (e.g. REPORT_EOF) if the value might contain EOF.
Expected: No more Invalid format or Matching delimiter not found errors.
When this applies
- a step fails with Unable to process file command 'output' successfully plus Invalid format '...'
- you write command output, JSON, or markdown into $GITHUB_OUTPUT
When it does NOT apply
- the error names file command 'env' instead (same idea, but the file is $GITHUB_ENV)
- the value is single-line (then look for a missing key [your value] instead)
Compatibility
GitHub Actions runners on all OSes. Applies to $GITHUBOUTPUT and, by analogy, $GITHUBENV.
Variants of this error
##[error]Invalid format '...'
The detail line naming the offending line. Same fix.
##[error]Invalid value. Matching delimiter not found 'EOF'
The delimiter collided with file content or was not alone on its line. Pick a unique delimiter and ensure a trailing newline before it.
Why it happens
$GITHUB_OUTPUT replaced the old ::set-output command with a plain file protocol: one name=value per line, or a heredoc block. Anything else in the file is a parse error, and the runner fails the step rather than guessing.
Edge cases and pitfalls
- If the value is produced by cat file >> $GITHUB_OUTPUT, make sure the file ends with a newline or the closing delimiter glues onto the last line.
- Values containing the delimiter string terminate the block early; generate a random delimiter for untrusted content.
- Composite actions have the same rule; the error looks identical.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.