Problem
The workflow was failing with SyntaxError: Unexpected non-whitespace character after JSON at position 3 due to double-encoding of JSON output.
When using return in github-script, the output gets wrapped in extra quotes:
- Expected:
{"issues":["986"],"pr":984}
- Actual:
"{\"issues\":[\"986\"],\"pr\":984}"
This made JSON.parse() fail in the second step.
Problem
The workflow was failing with
SyntaxError: Unexpected non-whitespace character after JSON at position 3due to double-encoding of JSON output.When using
returningithub-script, the output gets wrapped in extra quotes:{"issues":["986"],"pr":984}"{\"issues\":[\"986\"],\"pr\":984}"This made
JSON.parse()fail in the second step.