fix: give each step execution its own runner file command directory - #6154
Open
McNultyyy wants to merge 1 commit into
Open
fix: give each step execution its own runner file command directory#6154McNultyyy wants to merge 1 commit into
McNultyyy wants to merge 1 commit into
Conversation
Every step wrote its file commands to the same paths in the job container: workflow/outputcmd.txt, statecmd.txt, pathcmd.txt, envs.txt and SUMMARY.md. A step therefore read whatever the previously executed step had left in them. The visible consequence is composite actions leaking outputs. GitHub scopes an output written by a composite action's inner step to that inner step, and exposes only the outputs the action declares. In act the inner step's writes to $GITHUB_OUTPUT were still sitting in the shared file when the enclosing job step processed it, so they appeared as outputs of the step that used the action. Each step execution now gets its own directory. The file commands are also recorded against the id of the step they belong to instead of the mutable CurrentStep field, and composite script names are derived from the stable id of the step the composite runs for rather than from CurrentStep. The new composite-undeclared-outputs fixture covers a plain and a nested composite action, over both $GITHUB_OUTPUT and ::set-output. It fails on master and passes here. Refs nektos#2184, nektos#2697, nektos#2553 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
McNultyyy
added a commit
to McNultyyy/act
that referenced
this pull request
Aug 6, 2026
This was referenced Aug 6, 2026
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2184, #2697, #2553.
Every step writes its file commands to the same five paths in the job container —
workflow/outputcmd.txt,statecmd.txt,pathcmd.txt,envs.txt,SUMMARY.md— and reads them back after it finishes. A step therefore reads whatever the previously executed step left behind.The visible consequence is composite actions leaking outputs. GitHub scopes an output written by a composite action's inner step to that inner step, exposing only the outputs the action declares in its
outputs:. In act the inner step's writes to$GITHUB_OUTPUTare still sitting in the shared file when the enclosing job step processes it, so they surface as outputs of the step that used the action.What this does
Each step execution gets its own
workflow/cmds-<n>-<stage>/directory, so nothing is inherited from the previous step.Two related fixes for the same root cause — step-scoped data keyed off mutable state:
RunContext.CurrentStepholds by the time they are read. Same for the::set-output/::save-statehandlers, which now take the step id of the step whose output stream they are attached to.parentStepIDinstead ofCurrentStep.Testing
New
composite-undeclared-outputsfixture, added to the dockerTestRunEventtable. It asserts that an output a composite action declares is visible on the step that used it, and that outputs it does not declare are not — for a plain composite and one nesting another composite, over both$GITHUB_OUTPUTand legacy::set-output.It fails on master and passes with this change, which is the point of including it.
The rest of the composite and file-command suite is green:
uses-composite,uses-nested-composite,composite-fail-with-output,act-composite-env-test,do-not-leak-step-env-in-composite,uses-composite-with-pre-and-post-steps,outputs,GITHUB_STATE,environment-files.Things to be aware of
$GITHUB_OUTPUT,$GITHUB_ENV,$GITHUB_PATH,$GITHUB_STATEand$GITHUB_STEP_SUMMARYchange. Anything that hard-codes them rather than reading the environment variable would break — I could not find such a case, but it is worth a second pair of eyes.$GITHUB_STEP_SUMMARYbecomes per step execution rather than per step id. Summaries are already emitted per step, so this should not be observable.matchCmdFilehelper.I have deliberately not marked #2184 / #2697 / #2553 as closed. This addresses the mechanism all three describe, but they should be re-checked against the original reproductions before closing.
🤖 Generated with Claude Code