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

Function templatableIntValue

pkg/workflow/templatables.go:335–343  ·  view source on GitHub ↗

templatableIntValue parses a *string templatable integer value to int. Returns 0 if value is nil or is a GitHub Actions expression (not evaluable at compile time). Returns the parsed integer for literal numeric strings.

(value *string)

Source from the content-addressed store, hash-verified

333// Returns 0 if value is nil or is a GitHub Actions expression (not evaluable at compile time).
334// Returns the parsed integer for literal numeric strings.
335func templatableIntValue(value *string) int {
336 if value == nil {
337 return 0
338 }
339 if n, err := strconv.Atoi(*value); err == nil {
340 return n
341 }
342 return 0 // expression strings are not evaluable at compile time
343}

Calls

no outgoing calls