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

Function resolveRuntimeCooldown

pkg/workflow/nodejs.go:280–331  ·  view source on GitHub ↗

resolveRuntimeCooldown returns whether runtime-associated dependency installs should apply the default release-age cooldown. Defaults to true; runtimes. .cooldown: false disables it.

(workflowData *WorkflowData, runtimeID string)

Source from the content-addressed store, hash-verified

278// resolveRuntimeCooldown returns whether runtime-associated dependency installs should apply
279// the default release-age cooldown. Defaults to true; runtimes.<id>.cooldown: false disables it.
280func resolveRuntimeCooldown(workflowData *WorkflowData, runtimeID string) bool {
281 if workflowData == nil {
282 return true
283 }
284
285 if workflowData.ParsedFrontmatter != nil && workflowData.ParsedFrontmatter.RuntimesTyped != nil {
286 var runtimeConfig *RuntimeConfig
287 switch runtimeID {
288 case "node":
289 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Node
290 case "python":
291 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Python
292 case "go":
293 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Go
294 case "uv":
295 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.UV
296 case "bun":
297 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Bun
298 case "deno":
299 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Deno
300 case "dotnet":
301 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Dotnet
302 case "elixir":
303 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Elixir
304 case "gh-aw":
305 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.GhAw
306 case "haskell":
307 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Haskell
308 case "java":
309 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Java
310 case "ruby":
311 runtimeConfig = workflowData.ParsedFrontmatter.RuntimesTyped.Ruby
312 }
313 if runtimeConfig != nil && runtimeConfig.Cooldown != nil {
314 return *runtimeConfig.Cooldown
315 }
316 }
317
318 runtimeAny, ok := workflowData.Runtimes[runtimeID]
319 if !ok {
320 return true
321 }
322 runtimeMap, ok := runtimeAny.(map[string]any)
323 if !ok {
324 return true
325 }
326 cooldown, ok := runtimeMap["cooldown"].(bool)
327 if !ok {
328 return true
329 }
330 return cooldown
331}

Calls

no outgoing calls

Tested by

no test coverage detected