# GitHub Actions: Error: Unable to process file command 'output' successfully. Invalid format 'x'

**Code:** `Unable to process file command` · **Category:** CI/CD · **Seen on:** GitHub Actions

A line written to `$GITHUB_OUTPUT`, `$GITHUB_ENV` or `$GITHUB_STATE` is not in `name=value` form — usually a multi-line value without a delimiter.

## Meaning

These files accept `NAME=value` for single lines and `NAME<<DELIMITER` … `DELIMITER` for multi-line values. A value that contains a newline (a file's content, JSON, a commit message) breaks the format. Use a heredoc delimiter, or encode the value.

## Common causes

- Multi-line value written as a single `name=value` line
- Value containing a newline from `$(cat file)` or command output
- Missing `=` between name and value
- Delimiter text appearing inside the value
- Windows line endings in the written text

## Quick fix

1. Use the delimiter syntax: `name<<EOF` … `EOF`
2. Write JSON in one line (`jq -c`)
3. Use a random delimiter when the value could contain `EOF`

## Detailed fix by platform

### GitHub Actions

1. `{ echo "notes<<$EOF"; cat notes.md; echo "$EOF"; } >> "$GITHUB_OUTPUT"` after `EOF=$(openssl rand -hex 8)`

## Code examples

### Multi-line output

```yaml
- id: notes
  run: |
    EOF=$(openssl rand -hex 8)
    {
      echo "body<<$EOF"
      git log -5 --pretty=format:'%s'
      echo
      echo "$EOF"
    } >> "$GITHUB_OUTPUT"
- run: echo "${{ steps.notes.outputs.body }}"
```

## How to diagnose

1. **File** — output, env or state?
2. **Value** — Contains newlines?
3. **Syntax** — name=value or heredoc?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/cicd/gha-unable-to-process-file-command)
