diff --git a/README.md b/README.md index f5c6085..670c0ff 100644 --- a/README.md +++ b/README.md @@ -139,7 +139,7 @@ with: | ## Gotchas/limitations - The `with` inputs to the action need to be converted to a YAML mapping string (see examples above) -- All outputs from the action will be serialized as a JSON object output named `outputs` . You can access specific outputs by using the `fromJSON` helper in an expression. For example: +- All outputs from the action will be serialized as a JSON object output named `outputs`. You can access specific outputs by using the `fromJSON` helper in an expression. For example: ```yaml - id: setup_node uses: jenseng/dynamic-uses@v1 diff --git a/action.yml b/action.yml index 5682675..c18d98d 100644 --- a/action.yml +++ b/action.yml @@ -21,12 +21,15 @@ runs: env: uses: ${{ inputs.uses }} with: ${{ inputs.with }} + # inject the outputs value expression via env so that we can avoid + # GHA+shell escaping complications 😅 + outputs: ${{ '${{ toJSON(steps.run.outputs) }}' }} run: | mkdir -p ./.tmp-dynamic-uses && cat <./.tmp-dynamic-uses/action.yml outputs: outputs: - value: ${{ '\$' }}{{ toJSON(steps.run.outputs) }} + value: $outputs runs: using: composite steps: