getAWFVersionForSetup returns the AWF runtime version to inject as GH_AW_INFO_AWF_VERSION in setup steps so all job-local OTel spans can attribute telemetry to the firewall runtime that executed the job.
(data *WorkflowData)
| 54 | // GH_AW_INFO_AWF_VERSION in setup steps so all job-local OTel spans can |
| 55 | // attribute telemetry to the firewall runtime that executed the job. |
| 56 | func getAWFVersionForSetup(data *WorkflowData) string { |
| 57 | if data == nil { |
| 58 | return "" |
| 59 | } |
| 60 | firewallConfig := getFirewallConfig(data) |
| 61 | if firewallConfig == nil || !firewallConfig.Enabled { |
| 62 | return "" |
| 63 | } |
| 64 | if firewallConfig.Version != "" { |
| 65 | return firewallConfig.Version |
| 66 | } |
| 67 | return string(constants.DefaultFirewallVersion) |
| 68 | } |
| 69 | |
| 70 | // getInstallationVersion returns the version that will be installed for the given engine. |
| 71 | // This matches the logic in BuildStandardNpmEngineInstallSteps. |
no test coverage detected