Added documentation about support for outputs 📄

This commit is contained in:
Trevor Sullivan 2021-12-11 17:43:41 -07:00 committed by GitHub
parent 4c5eef8dc2
commit 3208510c3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,3 +58,19 @@
echo "first line"
echo "second line"
```
#### Capture Output from a Docker Container
You can capture output from the container, using the `::set-output` [workflow command](https://docs.github.com/en/actions/learn-github-actions/workflow-commands-for-github-actions) in GitHub Actions.
Steps that execute following this step can access the output using the `${{ steps.<step_id>.outputs.<output_name> }}` syntax.
For more information, see the [Contexts documentation](https://docs.github.com/en/actions/learn-github-actions/contexts) for GitHub Actions.
```yaml
- uses: pcgeek86/docker-run-action@v4
id: container_test
with:
image: mcr.microsoft.com/powershell
run: |
pwsh -EncodedCommand JABJAG4AcwB0AGEAbABsAGUAZABNAG8AZAB1AGwAZQBzACAAPQAgACgARwBlAHQALQBNAG8AZAB1AGwAZQAgAC0ATABpAHMAdABBAHYAYQBpAGwAYQBiAGwAZQApAC4ATgBhAG0AZQAgAC0AagBvAGkAbgAgACcALAAnAAoAJwA6ADoAcwBlAHQALQBvAHUAdABwAHUAdAAgAG4AYQBtAGUAPQBjAG8AbgB0AGEAaQBuAGUAcgBfAG8AdQB0AHAAdQB0ADoAOgB7ADAAfQAnACAALQBmACAAJABJAG4AcwB0AGEAbABsAGUAZABNAG8AZAB1AGwAZQBzAA==
- run: echo "Installed PowerShell modules are: ${{ steps.container_test.outputs.container_output }}"
```