mirror of
https://github.com/actions/github-script.git
synced 2026-02-08 03:57:27 +00:00
Add string-encoding example to README
This commit is contained in:
parent
99889c25e0
commit
de1677be2d
1 changed files with 16 additions and 0 deletions
16
README.md
16
README.md
|
|
@ -132,3 +132,19 @@ jobs:
|
||||||
|
|
||||||
This will print the full diff object in the screen; `result.data` will
|
This will print the full diff object in the screen; `result.data` will
|
||||||
contain the actual diff text.
|
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!"
|
||||||
|
```
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue