MCPcopy Create free account
hub / github.com/github/gh-aw / addCopilotModelEnv

Method addCopilotModelEnv

pkg/workflow/copilot_engine_execution.go:563–573  ·  view source on GitHub ↗
(env map[string]string, workflowData *WorkflowData, modelConfigured bool, modelEnvVar string)

Source from the content-addressed store, hash-verified

561}
562
563func (e *CopilotEngine) addCopilotModelEnv(env map[string]string, workflowData *WorkflowData, modelConfigured bool, modelEnvVar string) {
564 // Set the model environment variable.
565 // The model is always passed via the native COPILOT_MODEL env var, which the Copilot CLI reads directly.
566 // When model is not configured, map the GitHub org variable to COPILOT_MODEL so users can set a default.
567 if modelConfigured {
568 copilotExecLog.Printf("Setting %s env var for model: %s", constants.CopilotCLIModelEnvVar, workflowData.EngineConfig.Model)
569 env[constants.CopilotCLIModelEnvVar] = workflowData.EngineConfig.Model
570 return
571 }
572 env[constants.CopilotCLIModelEnvVar] = compilerenv.BuildModelOverrideExpression(modelEnvVar, compilerenv.DefaultModelCopilot, constants.CopilotBYOKDefaultModel)
573}
574
575func (e *CopilotEngine) addCopilotFinalStepEnv(env map[string]string, workflowData *WorkflowData) {
576 // Inject GH_AW_ENGINE_CWD when engine.cwd is configured.

Callers 1

buildCopilotStepEnvMethod · 0.95

Calls 2

PrintfMethod · 0.45

Tested by

no test coverage detected