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

Request to add diffDoesNotAdd or similar parameter #138

Open Yadunund opened 3 months ago

Yadunund commented 3 months ago

If a PR is opened which removes the usage of a string and at the same time wants to include a new Github action to ensure instances of the string are not present in future PRs, relying ondiffDoesNotContain parameter will lead to an action failure since the current diff includes deletions of the configured string. Hence, a diffDoesNotAdd parameter that only checks the diff additions for instances of the configured string would be great!

JJ commented 3 months ago

Thanks for opening the issue. This is going to need a certain amount of internal refactoring, so I set it for future releases.

JJ commented 3 months ago

Hum, I'm checking parse-diff code and that's not an information that's directly in the data parsed from the diff... Best effort here would be to check if the word is in the lines added, but if it was already there, it will make no difference, it will fail anyway. I can check if it's in the lines added and not in the existing lines, however...