Update scripts/scan_pr_lib.rb
Co-authored-by: Copilot <[email protected]>
This commit is contained in:
+15
-6
@@ -104,13 +104,22 @@ EOF
|
|||||||
"GITHUB_STEP_SUMMARY" => "/dev/null"
|
"GITHUB_STEP_SUMMARY" => "/dev/null"
|
||||||
}
|
}
|
||||||
|
|
||||||
# bash does not like variable names with dashes like the ones Actions
|
# Merge action inputs into environment, formatting keys as INPUT_...
|
||||||
# uses (e.g. INPUT_REPO-TOKEN). Passing them through `env` instead of
|
action_inputs_env = action_inputs.each_with_object({}) do |(name, value), h|
|
||||||
# manually setting them does the job.
|
h["INPUT_#{name.to_s.upcase}"] = value unless value.nil?
|
||||||
action_inputs_env_str = action_inputs.map { |name, value| "\"INPUT_#{name.upcase}=#{value}\"" }.join(" ")
|
end
|
||||||
dev_cmd = "./node_modules/.bin/nodemon --exec \"env #{action_inputs_env_str} node -r esbuild-register\" src/main.ts"
|
env = dev_cmd_env.merge(action_inputs_env)
|
||||||
|
|
||||||
Open3.popen2e(dev_cmd_env, dev_cmd) do |stdin, out|
|
dev_cmd = [
|
||||||
|
"./node_modules/.bin/nodemon",
|
||||||
|
"--exec",
|
||||||
|
"node",
|
||||||
|
"-r",
|
||||||
|
"esbuild-register",
|
||||||
|
"src/main.ts"
|
||||||
|
]
|
||||||
|
|
||||||
|
Open3.popen2e(env, *dev_cmd) do |stdin, out|
|
||||||
while line = out.gets
|
while line = out.gets
|
||||||
puts line.gsub(@github_token, "<REDACTED>")
|
puts line.gsub(@github_token, "<REDACTED>")
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user