Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action doesn't return error condition to the action runner (when 401 authorization failure) #132

Open
rkdarst opened this issue Sep 29, 2020 · 1 comment
Labels
bug Something isn't working help wanted Pull requests welcome :)

Comments

@rkdarst
Copy link
Contributor

rkdarst commented Sep 29, 2020

What happened?

We tried setting this up over at coderefinery/coderefinery-twitter. When the PR is merged, we get this error message from the action:

(node:2866) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'message' of undefined
Running twitter-together version 0.0.0-development
    at /home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:25821:56
Tweeting: If you are getting this message, CodeRefinery has set up tweet-by git using Github Actions!
    at Array.map (<anonymous>)

    at handlePush (/home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:25821:37)
https://github.com/gr2m/twitter-together
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2866) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2866) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
error
Error: HTTP Error: 401 Authorization Required
    at Request._callback (/home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:41822:9)
    at Request.self.callback (/home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:19751:22)
    at Request.emit (events.js:210:5)
    at Request.<anonymous> (/home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:20727:10)
    at Request.emit (events.js:210:5)
    at IncomingMessage.<anonymous> (/home/runner/work/_actions/gr2m/twitter-together/v1.x/dist/index.js:20649:12)
    at Object.onceWrapper (events.js:299:28)
    at IncomingMessage.emit (events.js:215:7)
    at endReadableNT (_stream_readable.js:1184:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)

The actual problem was fixed (we needed to give the app write permissions). But, the gh-action runner reports that the action succeeded.

What did you expect to happen?

Ideally the error would be propagated to the return code and noticed by the action runner - and the action would report failure to the users.

What the problem might be

I haven't dug into the code any, I'm not that good at javascript.

Other notes
Thanks for this action - it's exactly what we needed to start actually using twitter well, and I can only imagine it will be come indispensable for many projects.

@rkdarst rkdarst added the bug Something isn't working label Sep 29, 2020
@gr2m
Copy link
Contributor

gr2m commented Oct 1, 2020

Thanks, I'll look into it as soon as I can, but it could take a while. If anyone beats me to it, please be my guest, send a PR

@gr2m gr2m added the help wanted Pull requests welcome :) label Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Pull requests welcome :)
Projects
None yet
Development

No branches or pull requests

2 participants