Skip to content

Commit

Permalink
Merge pull request #43 from matt-ball/fail-check
Browse files Browse the repository at this point in the history
guard setFailed
  • Loading branch information
matt-ball authored Oct 11, 2021
2 parents e28dce0 + a296a70 commit 573e42a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -254297,7 +254297,9 @@ function removeEmpty (obj) {

function runNewman (options) {
newman.run(options, (err) => {
core.setFailed('Newman run failed! ' + (err || ''))
if (err) {
core.setFailed('Newman run failed! ' + (err || ''))
}
}).on('done', (err, summary) => {
if (!options.suppressExitCode && (err || summary.run.failures.length)) {
core.setFailed('Newman run failed! ' + (err || ''))
Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@ function removeEmpty (obj) {

function runNewman (options) {
newman.run(options, (err) => {
core.setFailed('Newman run failed! ' + (err || ''))
if (err) {
core.setFailed('Newman run failed! ' + (err || ''))
}
}).on('done', (err, summary) => {
if (!options.suppressExitCode && (err || summary.run.failures.length)) {
core.setFailed('Newman run failed! ' + (err || ''))
Expand Down
2 changes: 1 addition & 1 deletion 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": "newman-action",
"version": "1.0.1",
"version": "1.0.2",
"description": "Run Postman collections with Newman as a GitHub Action",
"main": "dist/index.js",
"repository": {
Expand Down

0 comments on commit 573e42a

Please sign in to comment.