Skip to content

Commit

Permalink
Merge pull request #24 from stackql/feature/updates
Browse files Browse the repository at this point in the history
stderr fix
  • Loading branch information
jeffreyaven authored Oct 17, 2023
2 parents 9bf2d2f + 0d224dd commit b16e378
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Check the "Use GitHub Provider" step in [setup-stackql.yml](.github/workflows/se

```yaml
- name: setup StackQL
uses: stackql/setup-stackql@v1.2.0
uses: stackql/setup-stackql@v2.0.0
with:
use_wrapper: true

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

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-stackql",
"version": "1.2.0",
"version": "2.0.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions wrapper/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4208,16 +4208,17 @@ async function checkStackQL () {
core.setOutput('stdout', stdout.contents);
core.setOutput('stderr', stderr.contents);

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

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

})();
Expand Down
7 changes: 4 additions & 3 deletions wrapper/stackql.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ async function checkStackQL () {
core.setOutput('stdout', stdout.contents);
core.setOutput('stderr', stderr.contents);

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

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

0 comments on commit b16e378

Please sign in to comment.