File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -69,11 +69,13 @@ public void testGitHubWorkflowRegexSync() throws Exception {
6969
7070 String content = Files .readString (workflowFile .toPath ());
7171
72- // The workflow must use the exact same constant name in its grep/sed matching regex
72+ // The workflow must use the constant name followed by a flexible regex query in single or double quotes.
73+ // E.g., matches 'FLUTTER_VERSION="[0-9.]+"' or 'FLUTTER_VERSION="[0-9.]*"' or "FLUTTER_VERSION='[0-9.]+'"
74+ Pattern regexPattern = Pattern .compile ("FLUTTER_VERSION=['\" ].+?['\" ]" );
7375 assertTrue (
74- "update_flutter.yaml must reference the 'FLUTTER_VERSION=\" [0-9.]+\" ' constant in its search-and-replace step. " +
75- "If you renamed this constant in tool/provision_flutter.sh, you must also update it inside update_flutter.yaml ." ,
76- content . contains ( "FLUTTER_VERSION= \" [0-9.]+ \" " )
76+ "update_flutter.yaml must reference the 'FLUTTER_VERSION' constant with a regex pattern (e.g. 'FLUTTER_VERSION =\" [0-9.]+\" ') " +
77+ "in its search-and-replace logic ." ,
78+ regexPattern . matcher ( content ). find ( )
7779 );
7880 }
7981}
You can’t perform that action at this time.
0 commit comments