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

Prefix_only doesn't work #18

Open
GabrieleCalarota opened this issue Sep 28, 2021 · 2 comments · May be fixed by #19
Open

Prefix_only doesn't work #18

GabrieleCalarota opened this issue Sep 28, 2021 · 2 comments · May be fixed by #19

Comments

@GabrieleCalarota
Copy link

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

@GabrieleCalarota
Copy link
Author

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;
    }

@GabrieleCalarota GabrieleCalarota linked a pull request Sep 28, 2021 that will close this issue
@GabrieleCalarota
Copy link
Author

Any update on this @jaredly ?

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

Successfully merging a pull request may close this issue.

1 participant