-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
### Goal | ||
|
||
Demonstrate / reproduce the issue reported in https://github.com/rollup/rollup/issues/4995. | ||
|
||
### Prerequisites | ||
|
||
`node` and `npx` need to be installed. | ||
|
||
First do an `npm install`. | ||
|
||
### How-To | ||
|
||
The issue can be reproduced both exec both of `@actions/exec` and `child_process`. The node scripts each use the respective `exec` function to invoke [test.sh](test.sh). The bash script uses `npx` to invoke _rollup_, first v3.21.5 (OK), then v3.21.6 (NOK). After that second invocation, the subsequent `echo` fails. | ||
|
||
@actions/exec: | ||
|
||
``` | ||
node actions.js | ||
``` | ||
|
||
child_process: | ||
|
||
``` | ||
node child_process.js | ||
``` | ||
|
||
### Errors | ||
|
||
@actions/exec: | ||
|
||
``` | ||
Error occurred during test.sh: Error: The process '/bin/bash' failed with exit code null | ||
at ExecState._setResult (/Users/manu/incon.ai/rollup-stdout-repro/node_modules/@actions/exec/lib/toolrunner.js:592:25) | ||
at ExecState.CheckComplete (/Users/manu/incon.ai/rollup-stdout-repro/node_modules/@actions/exec/lib/toolrunner.js:575:18) | ||
at ChildProcess.<anonymous> (/Users/manu/incon.ai/rollup-stdout-repro/node_modules/@actions/exec/lib/toolrunner.js:469:27) | ||
at ChildProcess.emit (node:events:513:28) | ||
at maybeClose (node:internal/child_process:1091:16) | ||
at Socket.<anonymous> (node:internal/child_process:449:11) | ||
at Socket.emit (node:events:513:28) | ||
at Pipe.<anonymous> (node:net:322:12) | ||
``` | ||
|
||
child_process: | ||
|
||
``` | ||
Error occurred during test.sh: Error: Command failed: bash test.sh | ||
[...] | ||
at ChildProcess.exithandler (node:child_process:419:12) | ||
at ChildProcess.emit (node:events:513:28) | ||
at maybeClose (node:internal/child_process:1091:16) | ||
at Socket.<anonymous> (node:internal/child_process:449:11) | ||
at Socket.emit (node:events:513:28) | ||
at Pipe.<anonymous> (node:net:322:12) { | ||
code: null, | ||
killed: false, | ||
signal: 'SIGPIPE', | ||
cmd: 'bash test.sh' | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const { exec } = require('@actions/exec'); | ||
|
||
async function test() { | ||
try { | ||
await exec('bash test.sh'); | ||
console.log('test.sh completed successfully!'); | ||
} catch (error) { | ||
console.error('Error occurred during test.sh:', error); | ||
} | ||
} | ||
|
||
test(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const { exec } = require('child_process'); | ||
|
||
function test() { | ||
exec('bash test.sh', (error, stdout, stderr) => { | ||
if (error) { | ||
console.error('Error occurred during test.sh:', error); | ||
} else { | ||
console.log('test.sh completed successfully!'); | ||
} | ||
if (stdout) { | ||
console.log('test.sh output:', stdout); | ||
} | ||
if (stderr) { | ||
console.error('test.sh error output:', stderr); | ||
} | ||
}); | ||
} | ||
|
||
test(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "nodetest", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "actions.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"dependencies": { | ||
"@actions/exec": "^1.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
input: 'actions.js', | ||
output: { | ||
file: 'dist/bundle.js', | ||
format: 'es', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
echo "before" | ||
|
||
npx rollup@3.21.5 -c | ||
|
||
echo "between" | ||
|
||
npx rollup@3.21.6 -c | ||
|
||
echo "after" |