Khan/pull-request-comment-trigger

Prefix_only doesn't work

Opened this issue · 2 comments

Hi,

I'm encountering this issue using this action khan/pull-request-comment-trigger@master using:

        - uses: khan/pull-request-comment-trigger@master
          id: check
          with:
            trigger: '!deploy'
            prefix_only: 'true'
            reaction: rocket
          env:
            GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

Action gets triggered also if "!deploy" is in the middle of a comment (not according to README.md docs)

Also --> trying to get steps.check.outputs.comment_body is empty

This line of code should be like this:

    const prefixOnly = core.getInput("prefix_only") === 'true';
    if ((prefixOnly && !body.startsWith(trigger)) || (!prefixOnly && !body.includes(trigger))) {
        core.setOutput("triggered", "false");
        return;
    }

Any update on this @jaredly ?