File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -298,3 +298,20 @@ string defaultBranchNames() {
298
298
not exists ( string default_branch_name | repositoryDataModel ( _, default_branch_name ) ) and
299
299
result = [ "main" , "master" ]
300
300
}
301
+
302
+ string getRepoRoot ( ) {
303
+ exists ( Workflow w |
304
+ w .getLocation ( ) .getFile ( ) .getRelativePath ( ) .indexOf ( "/.github/workflows" ) > 0 and
305
+ result =
306
+ w .getLocation ( )
307
+ .getFile ( )
308
+ .getRelativePath ( )
309
+ .prefix ( w .getLocation ( ) .getFile ( ) .getRelativePath ( ) .indexOf ( "/.github/workflows" ) + 1 ) and
310
+ // exclude workflow_enum reusable workflows directory root
311
+ not result .indexOf ( ".github/reusable_workflows/" ) > - 1
312
+ or
313
+ not w .getLocation ( ) .getFile ( ) .getRelativePath ( ) .indexOf ( "/.github/workflows" ) > 0 and
314
+ not w .getLocation ( ) .getFile ( ) .getRelativePath ( ) .indexOf ( ".github/reusable_workflows" ) > - 1 and
315
+ result = ""
316
+ )
317
+ }
You can’t perform that action at this time.
0 commit comments