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

Function buildStandardNpmEngineInstallSteps

pkg/workflow/nodejs.go:94–124  ·  view source on GitHub ↗
(
	packageName string,
	defaultVersion string,
	stepName string,
	cacheKeyPrefix string,
	workflowData *WorkflowData,
	cooldownEnabled bool,
)

Source from the content-addressed store, hash-verified

92}
93
94func buildStandardNpmEngineInstallSteps(
95 packageName string,
96 defaultVersion string,
97 stepName string,
98 cacheKeyPrefix string,
99 workflowData *WorkflowData,
100 cooldownEnabled bool,
101) []GitHubActionStep {
102 nodejsLog.Printf("Building npm engine install steps: package=%s, version=%s", packageName, defaultVersion)
103
104 // Use version from engine config if provided, otherwise default to pinned version
105 version := defaultVersion
106 if workflowData.EngineConfig != nil && workflowData.EngineConfig.Version != "" {
107 version = workflowData.EngineConfig.Version
108 nodejsLog.Printf("Using engine config version: %s", version)
109 }
110
111 // Add npm package installation steps (includes Node.js setup)
112 // Always pass false for runInstallScripts: engine CLI installs must never run
113 // pre/post install scripts regardless of the workflow's run-install-scripts setting.
114 // This is a supply chain security requirement for the engine binary itself.
115 return GenerateNpmInstallSteps(
116 packageName,
117 version,
118 stepName,
119 cacheKeyPrefix,
120 true, // Include Node.js setup
121 false, // Always disable scripts for engine CLI installs
122 cooldownEnabled,
123 )
124}
125
126// BuildNpmEngineInstallStepsWithAWF injects an AWF installation step between the Node.js
127// setup step and the CLI install steps when the firewall is enabled. This eliminates the

Calls 2

GenerateNpmInstallStepsFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected