From de1677be2d353b50756fd046f8c541cf98f2076e Mon Sep 17 00:00:00 2001 From: Jonathan Clem Date: Wed, 8 Jan 2020 14:56:44 -0500 Subject: [PATCH] Add string-encoding example to README --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index afd990d..5180072 100644 --- a/README.md +++ b/README.md @@ -132,3 +132,19 @@ jobs: This will print the full diff object in the screen; `result.data` will contain the actual diff text. + +### Result encoding + +By default, the JSON-encoded return value of the function is set as the "result" in the +output of a github-script step. For some workflows, string encoding is preferred. This option can be set using the +`result-encoding` input: + + +```yaml +- uses: actions/github-script@0.3.0 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + result-encoding: string + script: | + return "I will be string (not JSON) encoded!" +```