JJ / github-pr-contains-action

Action that checks whether the body or diff in a PR contains a certain word.
MIT License
35 stars 33 forks source link

Workflow passing on empty description #86

Closed reetika-roy closed 1 year ago

reetika-roy commented 1 year ago

I have the following workflow

name: "Check PR"
on:
  pull_request:
    branches: ["main"]
    paths:
      - path/to/file/**

jobs:
  check_pr:
    runs-on: ubuntu-latest
    steps:
      - name: Check PR
        uses: JJ/github-pr-contains-action@master
        with:
          github-token: ${{github.token}}
          bodyContains: "[blah]"

I had a PR description that said [blah] and ran the workflow- it was fine. But then I edited it to remove the string and I expect it to fail. The workflow keeps passing even on re-triggering.

JJ commented 1 year ago

If I'm not wrong, is it possible that it did not trigger? I don't think the default pull_request trigger includes edited

reetika-roy commented 1 year ago

What if I explicitly say "Re-run workflow"- shouldn't that pull the more recently edited description?

JJ commented 1 year ago

What if I explicitly say "Re-run workflow"- shouldn't that pull the more recently edited description?

Not totally sure. Might use the self-same data. You can just edit the workflow, though, to include those triggers, as indicated in the example.

reetika-roy commented 1 year ago

The issue was having [] around the text. It works fine after I remove the [].