updateRequiredRuntime updates the version requirement, choosing the highest version
(runtime *Runtime, newVersion string, requirements map[string]*RuntimeRequirement)
| 261 | |
| 262 | // updateRequiredRuntime updates the version requirement, choosing the highest version |
| 263 | func updateRequiredRuntime(runtime *Runtime, newVersion string, requirements map[string]*RuntimeRequirement) { |
| 264 | existing, exists := requirements[runtime.ID] |
| 265 | |
| 266 | if !exists { |
| 267 | runtimeSetupLog.Printf("Adding new runtime requirement: %s (version=%s)", runtime.ID, newVersion) |
| 268 | requirements[runtime.ID] = &RuntimeRequirement{ |
| 269 | Runtime: runtime, |
| 270 | Version: newVersion, |
| 271 | Cooldown: true, |
| 272 | } |
| 273 | return |
| 274 | } |
| 275 | |
| 276 | // If new version is empty, keep existing |
| 277 | if newVersion == "" { |
| 278 | return |
| 279 | } |
| 280 | |
| 281 | // If existing version is empty, use new version |
| 282 | if existing.Version == "" { |
| 283 | existing.Version = newVersion |
| 284 | return |
| 285 | } |
| 286 | |
| 287 | // Compare versions and keep the higher one |
| 288 | if semverutil.Compare(newVersion, existing.Version) > 0 { |
| 289 | existing.Version = newVersion |
| 290 | } |
| 291 | } |
| 292 | |
| 293 | // standardGitHubHostedRunners is the allowlist of known runner labels that |
| 294 | // ship with Node.js pre-installed. Only exact labels (case-insensitive) listed here are |
no test coverage detected