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

Method addCopilotFinalStepEnv

pkg/workflow/copilot_engine_execution.go:575–589  ·  view source on GitHub ↗
(env map[string]string, workflowData *WorkflowData)

Source from the content-addressed store, hash-verified

573}
574
575func (e *CopilotEngine) addCopilotFinalStepEnv(env map[string]string, workflowData *WorkflowData) {
576 // Inject GH_AW_ENGINE_CWD when engine.cwd is configured.
577 applyEngineCwdEnv(env, workflowData)
578 applyEngineAndAgentEnv(env, workflowData, copilotExecLog)
579 // Always inject the Copilot integration ID for agentic workflows after all env merges
580 // so user-supplied env does not override this value.
581 env[constants.CopilotCLIIntegrationIDEnvVar] = constants.CopilotCLIIntegrationIDValue
582 // Add HTTP MCP header secrets to env for passthrough
583 for varName, secretExpr := range collectHTTPMCPHeaderSecrets(workflowData.Tools) {
584 if _, exists := env[varName]; !exists {
585 env[varName] = secretExpr
586 }
587 }
588 applyMCPScriptsSecretEnv(env, workflowData)
589}
590
591func (e *CopilotEngine) addCopilotSandboxEnv(env map[string]string, sandboxEnabled bool) {
592 // Inject the dummy BYOK sentinel and AWF_REFLECT_ENABLED only when the AWF sandbox is active.

Callers 1

buildCopilotStepEnvMethod · 0.95

Calls 4

applyEngineCwdEnvFunction · 0.85
applyEngineAndAgentEnvFunction · 0.85
applyMCPScriptsSecretEnvFunction · 0.85

Tested by

no test coverage detected