You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fmt.Sprintf("action-tag must be a full 40-character commit SHA (length: %d). Short SHAs are not allowed", len(strVal)),
86
-
"Use 'git rev-parse <ref>' to get the full SHA. Example:\n\n$ git rev-parse HEAD\na1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0\n\nThen use in workflow:\nfeatures:\n action-tag: \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0\"",
87
-
)
81
+
// Accept full 40-character commit SHA
82
+
ifisValidFullSHA(strVal) {
83
+
returnnil
88
84
}
89
85
90
-
returnnil
86
+
// Accept version tags like "v0", "v1", "v1.0.0"
87
+
ifisValidVersionTag(strVal) {
88
+
returnnil
89
+
}
90
+
91
+
returnNewValidationError(
92
+
"features.action-tag",
93
+
strVal,
94
+
fmt.Sprintf("action-tag must be a full 40-character commit SHA or a version tag (e.g. v0, v1.0.0). Got: %q", strVal),
95
+
"Use a version tag or a full commit SHA. Examples:\nfeatures:\n action-tag: \"v0\"\n\nOr with a full SHA:\nfeatures:\n action-tag: \"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0\"",
96
+
)
91
97
}
92
98
93
99
// isValidFullSHA checks if a string is a valid 40-character hexadecimal SHA
0 commit comments