When we do things in GitHub Action Workflows to shove state into json files for parsing later on, e.g.:
cat< state.json
${{ toJSON(github) }}
EOF
Bash will attempt to do any expansion of the resultant body as it is writing it to the file. We likely don't want expansion anyways, and in any case when expansion happens it may no longer be valid JSON and cause errors when trying to consume it later on.
If you however do:
cat<<"EOF" > state.json
[...]
by quoting any part of the here-doc delimiter, Bash won't do inline expansion.
When we do things in GitHub Action Workflows to shove state into json files for parsing later on, e.g.:
cat< state.json
${{ toJSON(github) }}
EOF
Bash will attempt to do any expansion of the resultant body as it is writing it to the file. We likely don't want expansion anyways, and in any case when expansion happens it may no longer be valid JSON and cause errors when trying to consume it later on.
If you however do:
cat<<"EOF" > state.json [...]
by quoting any part of the here-doc delimiter, Bash won't do inline expansion.