github-pr-contains-action icon indicating copy to clipboard operation
github-pr-contains-action copied to clipboard

Request to add diffDoesNotAdd or similar parameter

Open Yadunund opened this issue 1 year ago • 2 comments

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!

Yadunund avatar Jul 01 '24 20:07 Yadunund

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

JJ avatar Jul 02 '24 06:07 JJ

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...

JJ avatar Jul 02 '24 06:07 JJ