From ef2229fc0b7817efbc1b7b9fe08629d6fa75aee2 Mon Sep 17 00:00:00 2001 From: Grant Buskey Date: Mon, 14 Apr 2025 08:12:51 -0400 Subject: [PATCH] feat(k8s): add /github/home to containerAction mounts and surface createSecretForEnvs errors #181 (#198) * feat: add /github/home to containerAction mounts #181 * fix: add debug logging for failed secret creations #181 --- packages/k8s/src/hooks/run-container-step.ts | 8 +++++++- packages/k8s/src/k8s/utils.ts | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/k8s/src/hooks/run-container-step.ts b/packages/k8s/src/hooks/run-container-step.ts index 9322dc8..dbc98b4 100644 --- a/packages/k8s/src/hooks/run-container-step.ts +++ b/packages/k8s/src/hooks/run-container-step.ts @@ -28,7 +28,13 @@ export async function runContainerStep( let secretName: string | undefined = undefined if (stepContainer.environmentVariables) { - secretName = await createSecretForEnvs(stepContainer.environmentVariables) + try { + secretName = await createSecretForEnvs(stepContainer.environmentVariables) + } catch (err) { + core.debug(`createSecretForEnvs failed: ${JSON.stringify(err)}`) + const message = (err as any)?.response?.body?.message || err + throw new Error(`failed to create script environment: ${message}`) + } } const extension = readExtensionFromFile() diff --git a/packages/k8s/src/k8s/utils.ts b/packages/k8s/src/k8s/utils.ts index e46af8b..2d55279 100644 --- a/packages/k8s/src/k8s/utils.ts +++ b/packages/k8s/src/k8s/utils.ts @@ -42,6 +42,11 @@ export function containerVolumes( mountPath: '/github/file_commands', subPath: '_temp/_runner_file_commands' }, + { + name: POD_VOLUME_NAME, + mountPath: '/github/home', + subPath: '_temp/_github_home' + }, { name: POD_VOLUME_NAME, mountPath: '/github/workflow',