k8s: provision /github dirs per step so container uses:/JS actions get event.json#393
Open
DJRH wants to merge 1 commit into
Open
k8s: provision /github dirs per step so container uses:/JS actions get event.json#393DJRH wants to merge 1 commit into
DJRH wants to merge 1 commit into
Conversation
gurpalw-b2c2
approved these changes
Jul 6, 2026
In kubernetes container mode, containerised `uses:`/JS-action steps read the
event payload from GITHUB_EVENT_PATH (/github/workflow/event.json). That path
is populated by prepareJobScript only at prepare-job time (and only when the
job declares volumes), or by writeContainerStepScript for Docker container
steps. Plain run-script/JS-action steps never (re)provision /github, and the
runner stages event.json into _work/_temp *after* prepare-job runs, so any
prepare-time copy lands empty.
As a result, containerised uses: actions that need the event payload (e.g.
actions/dependency-review-action) receive an empty payload and fail. run:
steps are unaffected because they operate in /__w.
Provision /github/{home,workflow,file_commands} from the freshly merged
_work/_temp in runScriptStep, right before the step entrypoint executes, so
the current event.json is always present for the action.
20e0287 to
8f3bf1f
Compare
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.
Fixes #330. Also supersedes the prepare-time approach in #300, and relates to #337 / #347 (missing
/githubdirs in novolume).Problem
In
kubernetes-novolumecontainer mode, a containeriseduses:/JS-action step that reads the event payload viaGITHUB_EVENT_PATH(/github/workflow/event.json) receives an empty payload and fails. For exampleactions/dependency-review-actionerrors with a schema-validation failure:run:steps are unaffected because they operate in/__w.Root cause
This is the regression described in #330.
/github/{home,workflow}used to be copied per step inrun-script-step.ts(added in #287), but #293 ("Reduce the amount of data copied to the workflow pod") replaced that block with a_temp_pre→_tempmerge that only handles_tempand no longer copies_github_home/_github_workflowinto/github/./githubis otherwise provisioned only by:prepareJobScript(utils.ts) — once, at prepare-job time, and only when the job declaresuserMountVolumes.writeContainerStepScript(utils.ts) — for Docker container action steps.Plain run-script / JS-action steps never (re)provision
/github. And simply un-gatingprepareJobScript(as in #300) is not sufficient: the runner stagesevent.jsoninto_work/_temp/_github_workflowafter prepare-job completes, so a prepare-time copy is empty. It has to happen at step time.Fix
Provision
/github/{home,workflow,file_commands}from the freshly merged/__w/_tempinsiderunScriptStep, in the sameexecPodStepthat performs the temp merge — i.e. right before the step entrypoint runs. By then_work/_temp/_github_workflow/event.jsonis present, so the action sees the correct payload. It re-syncs each step, so later-arriving context files stay current. This restores the #287 behaviour within the new merge strategy from #293.Testing
npm run build-all(ncc bundle builds cleanly).kubernetes-novolumerunners: verified live that job containers now have/github/workflow/event.jsonpopulated, andactions/dependency-review-actionpasses where it previously failed.Happy to adjust placement (e.g. fold into
writeRunScript) or add coverage if maintainers prefer.