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

Function generateEnvCaptureStep

pkg/workflow/runtime_step_generator.go:50–55  ·  view source on GitHub ↗

generateEnvCaptureStep creates a step to capture an environment variable and export it. This is required because some setup actions don't export env vars, but AWF chroot mode needs them to be set in the environment to pass them to the container.

(envVar string, captureCmd string)

Source from the content-addressed store, hash-verified

48// This is required because some setup actions don't export env vars, but AWF chroot mode
49// needs them to be set in the environment to pass them to the container.
50func generateEnvCaptureStep(envVar string, captureCmd string) GitHubActionStep {
51 return GitHubActionStep{
52 fmt.Sprintf(" - name: Capture %s for AWF chroot mode", envVar),
53 fmt.Sprintf(" run: echo \"%s=$(%s)\" >> \"$GITHUB_ENV\"", envVar, captureCmd),
54 }
55}
56
57// generateSetupStep creates a setup step for a given runtime requirement
58func generateSetupStep(req *RuntimeRequirement, data *WorkflowData) GitHubActionStep {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected