Skip to content

Commit

Permalink
feature: log res.body
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongitmail committed Dec 15, 2020
1 parent e449f26 commit 4969d4b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions dist/index.js

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

5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ const request = require('superagent');

try {
const res = await request.post(url).send(obj);
if (res.status !== 200 || res.status !== 201) {
core.setFailed(`Webhook response code was: ${res.status}`);
console.log('Response body:', res.body);
if (![200, 201].includes(res.status)) {
core.setFailed(`Status code was not 200 or 201. Was: ${res.status}`);
}
} catch (error) {
core.setFailed(error.message);
Expand Down

0 comments on commit 4969d4b

Please # to comment.