Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter out expressions that are certainly safe
Update the expressions matcher logic to not complain about expressions that can be proven to be safe because they consist exclusively of literals[1] and/or functions[2] whose output does not contain any of the input values (i.e. predicate functions as well as `hashFiles`). The choice to match twice, once against the input with safe expressions removed and once against the actual input, may seem unnecessarily bad from a performance ponit of view. However, if the stripped input does contain a problem, we want to get the matches on the original input to present to the user. The performance impact is minimized by using the `Regexp.Find` method which will return on the first match. -- 1. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#literals 2. https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions#functions -- Signed-off-by: Eric Cornelissen <ericornelissen@gmail.com>
- Loading branch information