mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-06 02:53:15 +08:00
@@ -30,6 +30,9 @@ export interface ExecOptions {
|
||||
/** optional. How long in ms to wait for STDIO streams to close after the exit event of the process before terminating. defaults to 10000 */
|
||||
delay?: number
|
||||
|
||||
/** optional. input to write to the process on STDIN. */
|
||||
input?: Buffer
|
||||
|
||||
/** optional. Listeners for output. Callback functions that will be called on these events */
|
||||
listeners?: {
|
||||
stdout?: (data: Buffer) => void
|
||||
|
||||
@@ -524,6 +524,14 @@ export class ToolRunner extends events.EventEmitter {
|
||||
resolve(exitCode)
|
||||
}
|
||||
})
|
||||
|
||||
if (this.options.input) {
|
||||
if (!cp.stdin) {
|
||||
throw new Error('child process missing stdin')
|
||||
}
|
||||
|
||||
cp.stdin.end(this.options.input)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user