From 8f3bf1f37e9b7bf910a645fda08e63fe5cc01906 Mon Sep 17 00:00:00 2001 From: DJRH Date: Mon, 6 Jul 2026 12:54:33 +0100 Subject: [PATCH] k8s: provision /github dirs per step for container uses:/JS actions 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. --- packages/k8s/src/hooks/run-script-step.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/k8s/src/hooks/run-script-step.ts b/packages/k8s/src/hooks/run-script-step.ts index 11ea9c54..5498a7eb 100644 --- a/packages/k8s/src/hooks/run-script-step.ts +++ b/packages/k8s/src/hooks/run-script-step.ts @@ -61,7 +61,12 @@ export async function runScriptStep( cp -a "$1" "$target" ' _ {} "$SRC" "$DST" \\;`, // Remove _temp_pre after merging - 'rm -rf /__w/_temp_pre' + 'rm -rf /__w/_temp_pre', + // Refresh /github from merged temp so uses:/JS-action steps see event.json + 'mkdir -p /github/home /github/workflow /github/file_commands', + 'cp -a "$DST/_github_home/." /github/home/ 2>/dev/null || true', + 'cp -a "$DST/_github_workflow/." /github/workflow/ 2>/dev/null || true', + 'cp -a "$DST/_runner_file_commands/." /github/file_commands/ 2>/dev/null || true' ] try {