JJ / github-pr-contains-action

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

github-pr-contains-action fails on big diffs? #133

Open Cellcote opened 5 months ago

Cellcote commented 5 months ago

We have been using this github action for a while and seems to be working fine for us with no real problems. Now I tried doing a refactor on the whole code base (~500 files touched, 34k lines of code), and the whole github action just does not work. The error we get is this:

Checking body contents
Checking diff contents
Getting diff for: <org>, <repo>, <pr number>
Error: ❌ There seems to be an error in an API request
This is usually due to using a GitHub token without the adequate scope

In other PRs, it works just fine, and also retries did not help.

Our config is like this:

steps:
      - uses: JJ/github-pr-contains-action@releases/v12.1
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          bodyDoesNotContain: "escribe the *\\*_what_\\*\\* and \\*\\*_why_\\*\\* of the change"

so ideally it should only scan the body (nothing crazy there) and skip scanning the diff if the config only specifies restrictions on the body of the PR.

JJ commented 5 months ago

Definitely needs a revision. Thanks for the report!