Skip to content
Latchkey

GitHub Actions composite action output empty in the caller in CI

A composite action only exposes an output if it is declared under outputs: and mapped to a step output via steps.<id>.outputs.<name>. The step must write to $GITHUB_OUTPUT and have an id.

What this error means

A caller step reads steps.<id>.outputs.<name> from the composite action and gets an empty string. The value was produced inside the action but never exported.

GitHub Actions
# caller
echo "version="
# steps.setup.outputs.version was empty: action.yml did not map the output
# to a step output, or the step did not write to $GITHUB_OUTPUT

Common causes

The output was not declared and mapped

A composite output must be declared under outputs: and set its value to steps.<id>.outputs.<name>. Without the mapping, the caller sees nothing.

The inner step did not write GITHUB_OUTPUT

The step that produces the value must have an id and append name=value to $GITHUB_OUTPUT for the mapping to resolve.

How to fix it

Declare and map the composite output

  1. Give the producing step an id and write to $GITHUB_OUTPUT.
  2. Declare the output under outputs: mapping to steps.<id>.outputs.<name>.
  3. Read it in the caller as steps.<action-step-id>.outputs.<name>.
action.yml
outputs:
  version:
    value: ${{ steps.detect.outputs.version }}
runs:
  using: composite
  steps:
    - id: detect
      run: echo "version=1.2.3" >> "$GITHUB_OUTPUT"
      shell: bash

Consume the output in the caller

Give the action step an id and read its output downstream.

.github/workflows/ci.yml
- id: setup
  uses: ./.github/actions/setup
- run: echo "${{ steps.setup.outputs.version }}"
  shell: bash

How to prevent it

  • Declare every composite output and map it to a step output.
  • Give producing steps an id and write to $GITHUB_OUTPUT.
  • Give the action step an id in the caller to read its outputs.

Frequently asked questions

What causes "composite "outputs" empty"?
A composite output must be declared under outputs: and set its value to steps.<id>.outputs.<name>. Without the mapping, the caller sees nothing.
How do I fix composite "outputs" empty?
Declare and map the composite output

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card