Skip to content

Commit de1677b

Browse files
committed
Add string-encoding example to README
1 parent 99889c2 commit de1677b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,3 +132,19 @@ jobs:
132132

133133
This will print the full diff object in the screen; `result.data` will
134134
contain the actual diff text.
135+
136+
### Result encoding
137+
138+
By default, the JSON-encoded return value of the function is set as the "result" in the
139+
output of a github-script step. For some workflows, string encoding is preferred. This option can be set using the
140+
`result-encoding` input:
141+
142+
143+
```yaml
144+
- uses: actions/github-script@0.3.0
145+
with:
146+
github-token: ${{secrets.GITHUB_TOKEN}}
147+
result-encoding: string
148+
script: |
149+
return "I will be string (not JSON) encoded!"
150+
```

0 commit comments

Comments
 (0)