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
// strings.ReplaceAll is not suitable here because it would incorrectly replace substrings
93
+
// For example, if we want to replace "actions/checkout@v1" to "actions/checkout@v1.2.3", it would also incorrectly match and replace in "actions/checkout@v1.2.3"
94
+
// making new string to "actions/checkout@v1.2.3.2.3"
95
+
//
96
+
// Instead, we use a regex pattern that ensures we only replace complete action references:
97
+
// Pattern: (<action>@<version>)($|\s|"|')
98
+
// - Group 1 (<action>@<version>): Captures the exact action reference
99
+
// - Group 2 ($|\s|"|'): Captures the delimiter that follows (end of line, whitespace, or quotes)
100
+
//
101
+
// Examples:
102
+
// - "actions/checkout@v1.2.3" - No match (no delimiter after v1)
// strings.ReplaceAll is not suitable here because it would incorrectly replace substrings
94
-
// For example, if we want to replace "actions/checkout@v1" to "actions/checkout@v1.2.3", it would also incorrectly match and replace in "actions/checkout@v1.2.3"
95
-
// making new string to "actions/checkout@v1.2.3.2.3"
96
-
//
97
-
// Instead, we use a regex pattern that ensures we only replace complete action references:
98
-
// Pattern: (<action>@<version>)($|\s|"|')
99
-
// - Group 1 (<action>@<version>): Captures the exact action reference
100
-
// - Group 2 ($|\s|"|'): Captures the delimiter that follows (end of line, whitespace, or quotes)
101
-
//
102
-
// Examples:
103
-
// - "actions/checkout@v1.2.3" - No match (no delimiter after v1)
0 commit comments