From d3c5a1eaede6992610c8886c78f6860fc6f5f7ed Mon Sep 17 00:00:00 2001 From: Adam Dobrawy Date: Tue, 12 Nov 2019 19:29:07 +0100 Subject: [PATCH] Use nodejs to start bash --- action.yml | 4 ++-- start.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 start.js diff --git a/action.yml b/action.yml index fa36f42..e583178 100644 --- a/action.yml +++ b/action.yml @@ -24,5 +24,5 @@ inputs: required: false default: '.' runs: - using: 'bash' - main: 'start.sh' + using: 'node12' + main: 'start.js' \ No newline at end of file diff --git a/start.js b/start.js new file mode 100644 index 0000000..2043c27 --- /dev/null +++ b/start.js @@ -0,0 +1,13 @@ +const spawn = require('child_process').spawn; + +const main = () => new Promise((resolve, reject) => { + const ssh = spawn('bash', ['start.sh'], { stdio: 'inherit' }); + ssh.on('close', resolve); + ssh.on('error', reject); +}); + +main().catch(err => { + console.err(err); + console.err(err.stack); + process.exit(-1); +}) \ No newline at end of file