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)
| 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. |
| 335 | func 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 | } |
no outgoing calls