File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -104,13 +104,22 @@ def execute_dependency_review(repo_nwo, event_file)
104
104
"GITHUB_STEP_SUMMARY" => "/dev/null"
105
105
}
106
106
107
- # bash does not like variable names with dashes like the ones Actions
108
- # uses (e.g. INPUT_REPO-TOKEN). Passing them through `env` instead of
109
- # manually setting them does the job.
110
- action_inputs_env_str = action_inputs . map { |name , value | "\" INPUT_#{ name . upcase } =#{ value } \" " } . join ( " " )
111
- dev_cmd = "./node_modules/.bin/nodemon --exec \" env #{ action_inputs_env_str } node -r esbuild-register\" src/main.ts"
112
-
113
- Open3 . popen2e ( dev_cmd_env , dev_cmd ) do |stdin , out |
107
+ # Merge action inputs into environment, formatting keys as INPUT_...
108
+ action_inputs_env = action_inputs . each_with_object ( { } ) do |( name , value ) , h |
109
+ h [ "INPUT_#{ name . to_s . upcase } " ] = value unless value . nil?
110
+ end
111
+ env = dev_cmd_env . merge ( action_inputs_env )
112
+
113
+ dev_cmd = [
114
+ "./node_modules/.bin/nodemon" ,
115
+ "--exec" ,
116
+ "node" ,
117
+ "-r" ,
118
+ "esbuild-register" ,
119
+ "src/main.ts"
120
+ ]
121
+
122
+ Open3 . popen2e ( env , *dev_cmd ) do |stdin , out |
114
123
while line = out . gets
115
124
puts line . gsub ( @github_token , "<REDACTED>" )
116
125
end
You can’t perform that action at this time.
0 commit comments