How do you pass outputs out of a composite action?
IntermediateConceptCustom Actions & Reusable Workflows
Answer
Map an internal step output to an action output with value:
outputs:
version:
description: App version
value: ${{ steps.v.outputs.version }}
runs:
using: composite
steps:
- id: v
shell: bash
run: echo "version=$(jq -r .version package.json)" >> "$GITHUB_OUTPUT"
The caller reads steps.<caller-step-id>.outputs.version.
More on Custom Actions & Reusable Workflows
What are the three kinds of custom action and how do you choose?BeginnerWrite a minimal composite action that installs Node and dependencies with caching.IntermediateWhat can a composite action not do compared to a job?IntermediateWhat does `action.yml` contain for a JavaScript action?IntermediateWhy must a JavaScript action commit its `dist/` or `node_modules`?IntermediateShow the core of a JavaScript action using the toolkit.Advanced