From 3208510c3f8065056b0674c3ab97d1c661ab0acf Mon Sep 17 00:00:00 2001 From: Trevor Sullivan Date: Sat, 11 Dec 2021 17:43:41 -0700 Subject: [PATCH] =?UTF-8?q?Added=20documentation=20about=20support=20for?= =?UTF-8?q?=20outputs=20=F0=9F=93=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index eab5a93..f489e25 100644 --- a/README.md +++ b/README.md @@ -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..outputs. }}` 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 }}" +```