Khan / pull-request-comment-trigger

A github action for detecting a "trigger" in a pull request description or comment
207 stars 91 forks source link

TypeError: Cannot read property 'includes' of null #16

Open regislegrand opened 3 years ago

regislegrand commented 3 years ago

We now have this error: Run khan/pull-request-comment-trigger@master TypeError: Cannot read property 'includes' of null at run (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:10700:15) at Object.871 (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:10729:1) Error: Unexpected error at __webpack_require__ (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:23:30) at startup (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:38:19) at /home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:42:18 at Object.<anonymous> (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:45:10) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14)

While your code didn't changed until a long time, I guess this is due to node/ubuntu versions: the ubuntu:latest has been updated a few days ago and I guess the error comes with it: https://github.com/actions/virtual-environments/releases/tag/ubuntu20%2F20210803.0

I also tried with ubuntu-18.04 but same error.

Thanks for help, Regards.

bitttttten commented 3 years ago

Also hitting this issue but perhaps it's related to an upgrade/change to the github action API?

    const body =
        context.eventName === "issue_comment"
            ? context.payload.comment.body
            : context.payload.pull_request.body;

    if (!body.includes(trigger)) {
        core.setOutput("triggered", "false");
        return;
    }

This is the line that throws the error. context comes from the @actions/github package.

I also noticed that the file being ran inside dist/index.js is different to the src file, so perhaps it was changed and not built. Although I have been using it successfully for a long time, not sure what suddenly changed.

janpio commented 3 years ago

Observing the same here.

Someone have an alternative that works right now?

agrebin commented 3 years ago

i am having the same error, it was working a few hours ago: Run khan/pull-request-comment-trigger@master with: trigger: /deploy prefix_only: false TypeError: Cannot read property 'includes' of null at run (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:10700:15) Error: Unexpected error at Object.871 (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:10729:1) at __webpack_require__ (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:23:30) at startup (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:38:19) at /home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:42:18 at Object.<anonymous> (/home/runner/work/_actions/khan/pull-request-comment-trigger/master/dist/index.js:45:10) at Module._compile (internal/modules/cjs/loader.js:959:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10) at Module.load (internal/modules/cjs/loader.js:815:32) at Function.Module._load (internal/modules/cjs/loader.js:727:14)

nicoevergara commented 2 years ago

The error should be occurring due to a lack of comments when opening a PR. This PR should address the issue, but I'm not sure how actively maintained the repo is.

glekner commented 2 years ago

does anyone have a reliable fork?