Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Open
regislegrand opened this issue Aug 5, 2021 · 5 comments
Open

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

regislegrand opened this issue Aug 5, 2021 · 5 comments

Comments

@regislegrand
Copy link

regislegrand commented Aug 5, 2021

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
Copy link

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
Copy link

janpio commented Aug 12, 2021

Observing the same here.

Someone have an alternative that works right now?

@agrebin
Copy link

agrebin commented Sep 3, 2021

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
Copy link

nicoevergara commented Nov 4, 2021

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
Copy link

glekner commented Jan 3, 2022

does anyone have a reliable fork?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants