Skip to content

Commit 0d224dd

Browse files
committed
stderr fix
1 parent 9bf2d2f commit 0d224dd

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Check the "Use GitHub Provider" step in [setup-stackql.yml](.github/workflows/se
1717

1818
```yaml
1919
- name: setup StackQL
20-
uses: stackql/setup-stackql@v1.2.0
20+
uses: stackql/setup-stackql@v2.0.0
2121
with:
2222
use_wrapper: true
2323

@@ -34,7 +34,7 @@ Check the "Use Google Provider" step in [setup-stackql.yml](.github/workflows/se
3434
3535
```yaml
3636
- name: setup StackQL
37-
uses: stackql/setup-stackql@v1.2.0
37+
uses: stackql/setup-stackql@v2.0.0
3838
with:
3939
use_wrapper: true
4040

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "setup-stackql",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"description": "",
55
"main": "index.js",
66
"scripts": {

wrapper/dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4208,16 +4208,17 @@ async function checkStackQL () {
42084208
core.setOutput('stdout', stdout.contents);
42094209
core.setOutput('stderr', stderr.contents);
42104210

4211-
if ((exitCode === 0 || exitCode === 2) && !stderr.contents) {
4211+
if (exitCode === 0 || exitCode === 2) {
42124212
// A exitCode of 0 is considered a success
42134213
// An exitCode of 2 may be returned when the '-detailed-exitcode' option
42144214
// is passed to plan. This denotes Success with non-empty
42154215
// diff (changes present).
42164216
return;
42174217
}
42184218

4219-
// A non-zero exitCode is considered an error
4220-
core.setFailed(`StackQL exited with error: ${stderr.contents}.`);
4219+
// If we reach this point, it means that the exitCode was neither 0 nor 2,
4220+
// which denotes an error. We can still use stderr.contents to provide more information about the error.
4221+
core.setFailed(`StackQL exited with error code ${exitCode}. Details: ${stderr.contents}.`);
42214222
})();
42224223

42234224
})();

wrapper/stackql.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ async function checkStackQL () {
4040
core.setOutput('stdout', stdout.contents);
4141
core.setOutput('stderr', stderr.contents);
4242

43-
if ((exitCode === 0 || exitCode === 2) && !stderr.contents) {
43+
if (exitCode === 0 || exitCode === 2) {
4444
// A exitCode of 0 is considered a success
4545
// An exitCode of 2 may be returned when the '-detailed-exitcode' option
4646
// is passed to plan. This denotes Success with non-empty
4747
// diff (changes present).
4848
return;
4949
}
5050

51-
// A non-zero exitCode is considered an error
52-
core.setFailed(`StackQL exited with error: ${stderr.contents}.`);
51+
// If we reach this point, it means that the exitCode was neither 0 nor 2,
52+
// which denotes an error. We can still use stderr.contents to provide more information about the error.
53+
core.setFailed(`StackQL exited with error code ${exitCode}. Details: ${stderr.contents}.`);
5354
})();

0 commit comments

Comments
 (0)