@@ -10,14 +10,19 @@ import (
1010
1111var runtimeStepGeneratorLog = logger .New ("workflow:runtime_step_generator" )
1212
13- // GenerateRuntimeSetupSteps creates GitHub Actions steps for runtime setup
14- func GenerateRuntimeSetupSteps (requirements []RuntimeRequirement ) []GitHubActionStep {
13+ // GenerateRuntimeSetupSteps creates GitHub Actions steps for runtime setup.
14+ // data is the WorkflowData for the workflow being compiled; it is forwarded to
15+ // generateSetupStep so that the gh-aw setup-cli step can use the lock-file-aware
16+ // pin resolver (getActionPinWithData) rather than the static embedded-pins fallback.
17+ // Pass nil only when WorkflowData is unavailable or when tests specifically
18+ // target non-gh-aw runtime behavior.
19+ func GenerateRuntimeSetupSteps (requirements []RuntimeRequirement , data * WorkflowData ) []GitHubActionStep {
1520 runtimeStepGeneratorLog .Printf ("Generating runtime setup steps: requirement_count=%d" , len (requirements ))
1621 runtimeSetupLog .Printf ("Generating runtime setup steps for %d requirements" , len (requirements ))
1722 var steps []GitHubActionStep
1823
1924 for _ , req := range requirements {
20- steps = append (steps , generateSetupStep (& req ))
25+ steps = append (steps , generateSetupStep (& req , data ))
2126
2227 // Add environment variable capture steps after setup actions for AWF chroot mode.
2328 // Most env vars are inherited via AWF_HOST_PATH, but Go is special.
@@ -50,7 +55,7 @@ func generateEnvCaptureStep(envVar string, captureCmd string) GitHubActionStep {
5055}
5156
5257// generateSetupStep creates a setup step for a given runtime requirement
53- func generateSetupStep (req * RuntimeRequirement ) GitHubActionStep {
58+ func generateSetupStep (req * RuntimeRequirement , data * WorkflowData ) GitHubActionStep {
5459 runtime := req .Runtime
5560 version := req .Version
5661 runtimeStepGeneratorLog .Printf ("Generating setup step for runtime: %s, version=%s, if=%s" , runtime .ID , version , req .IfCondition )
@@ -74,7 +79,8 @@ func generateSetupStep(req *RuntimeRequirement) GitHubActionStep {
7479 ifCondition : req .IfCondition ,
7580 cliVersion : version ,
7681 actionRepo : runtime .ActionRepo ,
77- fallbackActionRefTag : runtime .ActionVersion ,
82+ fallbackActionRefTag : version ,
83+ workflowData : data ,
7884 withFields : allExtraFields ,
7985 })
8086 if err != nil {
0 commit comments