This repository was archived by the owner on Aug 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
operations/innersource/dffml_operations_innersource Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -98,12 +98,27 @@ def groovy_files(self, repo: git_repository_checked_out.spec) -> dict:
98
98
expand = ["actions" ],
99
99
)
100
100
def action_yml_files (self , repo : git_repository_checked_out .spec ) -> dict :
101
+ list_of_action_yml_files = list (
102
+ pathlib .Path (repo .directory ).rglob ("**/action.yml" )
103
+ )
104
+ # Remove YAML files that are not GitHub Actions (for example if someone
105
+ # named a workflow action.yml).
106
+ remove_paths = set ()
107
+ for action_path in list_of_action_yml_files :
108
+ action_text = action_path .read_text (errors = "backslashreplace" )
109
+ action_text = action_text .replace ("\r " , "" )
110
+ # Look for runs: at top level
111
+ if not "runs:" in action_text .split ("\n " ):
112
+ remove_paths .add (action_path )
113
+ for remove_path in remove_paths :
114
+ list_of_action_yml_files .remove (remove_path )
115
+ # Conver to repo relative paths
101
116
list_of_action_yml_files = list (
102
117
map (
103
118
str ,
104
119
relative_paths (
105
120
repo .directory ,
106
- pathlib . Path ( repo . directory ). rglob ( "**/action.yml" )
121
+ list_of_action_yml_files ,
107
122
),
108
123
),
109
124
)
You can’t perform that action at this time.
0 commit comments