File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,30 @@ For more information on the available functions and automatic loaded variables,
2626| - | - |
2727| ` result ` | The output of the script as a JSON object. To add outputs to ` result ` , use ` Set-GitHubOutput ` . |
2828
29+ To use the outputs in a subsequent step, you can use the following syntax:
30+
31+ ``` yaml
32+ - uses : PSModule/GitHub-Script@v1
33+ id : set-output
34+ with :
35+ Script : |
36+ Set-GitHubOutput -Name 'Octocat' -Value @{
37+ Name = 'Octocat'
38+ Image = 'https://octodex.github.com/images/original.png'
39+ }
40+
41+ - name : Use outputs
42+ shell : pwsh
43+ env :
44+ result : ${{ steps.set-output.outputs.result }} # = '{"Octocat":{"Name":"Octocat","Image":"https://octodex.github.com/images/original.png"}}'
45+ name : ${{ fromJson(steps.set-output.outputs.result).Octocat.Name }} # = 'Octocat'
46+ run : |
47+ $result = $env:result | ConvertFrom-Json
48+ Write-Output $env:name
49+ Write-Output $result.Octocat.Image
50+ ` ` `
51+
52+
2953### Examples
3054
3155#### Example 1: Run a GitHub PowerShell script
You can’t perform that action at this time.
0 commit comments