From 1fe1a167dc5fca2ceaaac1626f4b5c1926270ec7 Mon Sep 17 00:00:00 2001 From: Justin Doak Date: Fri, 28 Aug 2026 12:25:42 -0400 Subject: [PATCH] Mirror all GITHUB_ envs to ALLSPICE_ equivalents --- pkg/runner/action.go | 2 ++ pkg/runner/run_context.go | 14 ++++++++++++++ pkg/runner/step.go | 9 +-------- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/pkg/runner/action.go b/pkg/runner/action.go index 87190a22..a5c270b0 100644 --- a/pkg/runner/action.go +++ b/pkg/runner/action.go @@ -240,6 +240,8 @@ func setupActionEnv(ctx context.Context, step actionStep, _ *remoteAction) error populateEnvsFromSavedState(step.getEnv(), step, rc) populateEnvsFromInput(ctx, step.getEnv(), step.getActionModel(), rc) + mirrorGithubEnvToAllSpice(*step.getEnv()) + return nil } diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index ad97ca06..1fe8c315 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -1088,6 +1088,20 @@ func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubCon return env } +func mirrorGithubEnvToAllSpice(env map[string]string) { + keysToMirror := []string{} + + for key := range env { + if strings.HasPrefix(key, "GITHUB_") { + keysToMirror = append(keysToMirror, strings.TrimPrefix(key, "GITHUB_")) + } + } + + for _, trimmedKey := range keysToMirror { + env["ALLSPICE_"+trimmedKey] = env["GITHUB_"+trimmedKey] + } +} + func setActionRuntimeVars(rc *RunContext, env map[string]string) { actionsRuntimeURL := os.Getenv("ACTIONS_RUNTIME_URL") if actionsRuntimeURL == "" { diff --git a/pkg/runner/step.go b/pkg/runner/step.go index dc8813ce..02a8b727 100644 --- a/pkg/runner/step.go +++ b/pkg/runner/step.go @@ -131,14 +131,7 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo (*step.getEnv())["GITEA_STEP_SUMMARY"] = (*step.getEnv())["GITHUB_STEP_SUMMARY"] } - { - // For AllSpice - (*step.getEnv())["ALLSPICE_OUTPUT"] = (*step.getEnv())["GITHUB_OUTPUT"] - (*step.getEnv())["ALLSPICE_STATE"] = (*step.getEnv())["GITHUB_STATE"] - (*step.getEnv())["ALLSPICE_PATH"] = (*step.getEnv())["GITHUB_PATH"] - (*step.getEnv())["ALLSPICE_ENV"] = (*step.getEnv())["GITHUB_ENV"] - (*step.getEnv())["ALLSPICE_STEP_SUMMARY"] = (*step.getEnv())["GITHUB_STEP_SUMMARY"] - } + mirrorGithubEnvToAllSpice(*step.getEnv()) _ = rc.JobContainer.Copy(actPath, &container.FileEntry{ Name: outputFileCommand,