IsMorePreciseVersion reports whether v1 should sort ahead of v2 in the action-version specificity ordering. Versions with more dot-separated components sort first (for example "v4.3.0" ahead of "v4"), and ties use lexicographic ordering. This is an ordering predicate, not a strict "more-precise-only
(v1, v2 string)
| 144 | // "more-precise-only" check. No validation is performed; callers should ensure |
| 145 | // both inputs are well-formed version tags. |
| 146 | func IsMorePreciseVersion(v1, v2 string) bool { |
| 147 | dots1 := strings.Count(v1, ".") |
| 148 | dots2 := strings.Count(v2, ".") |
| 149 | if dots1 != dots2 { |
| 150 | return dots1 > dots2 |
| 151 | } |
| 152 | return v1 > v2 |
| 153 | } |
| 154 | |
| 155 | // IsCompatible reports whether pinVersion is semver-compatible with requestedVersion. |
| 156 | // Semver compatibility is defined as both versions sharing the same major version. |