actions / actions/runner

Composite: Step Outputs are not available when in nested composite actions

Open
#2,009 18 comments 48 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good-first-issue Runner Bug
Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

Describe the bug
When a workflow uses a composite action, the post steps of actions within the Composite have their inputs evaluated with the Steps context.

However when the same Composite Action is nested in another Composite Action, the Steps context is lost for the Post steps.

Our usecase for wanting this is to cache dependencies effectively without polluting our Workflows.

To Reproduce
workflow uses a composite that uses a composite.

Reproduced here: https://github.com/antdking/composite-post-step-outputs-demo, specifically this workflow
This run includes debug output: https://github.com/antdking/composite-post-step-outputs-demo/actions/runs/2710027823

Expected behavior
Able to use Post steps for Composite Actions that are used by other Composite Actions.

Runner Version and Platform

Hosted runner, affects all Platforms

What's not working?

Please include error messages and screenshots.

When executing the Post Run for the wrapping composite:

 ##[debug]Evaluating condition for step: 'Post wrapperComposite'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Post wrapperComposite
##[debug]Loading inputs
##[debug]Loading env
Post job cleanup.
##[debug]Evaluating condition for step: 'run'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: run
##[debug]Loading inputs
##[debug]Evaluating: steps.setter.outputs.some-val
##[debug]Evaluating Index:
##[debug]..Evaluating Index:
##[debug]....Evaluating Index:
##[debug]......Evaluating steps:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'setter'
##[debug]....=> null
##[debug]..=> null
##[debug]=> null
##[debug]Result: null
##[debug]Loading env
Post job cleanup.
value received: 
Error: value: '' is not 'foo'
##[debug]Node Action run completed with exit code 1
##[debug]Finished: run
##[debug]Finishing: Post wrapperComposite

the setter Step seems to be missing when evaluating the post steps.

Runner and Worker's Diagnostic Logs

n/a

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproduced workflow .github/workflows/demo-nested-composites-break.yml and its linked debug run. Trace how the Steps context is evaluated for post steps in the nested composite, focusing on why setter resolves to null. Done means the nested composite can read the step output during post execution and the reproduction workflow succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.