|
1 | | -# Regex Match Commenter Action |
| 1 | +# Regular Expression Match Commenter Action |
2 | 2 |
|
3 | 3 | [](https://github.com/super-linter/super-linter) |
4 | 4 |  |
5 | 5 | [](https://github.com/zumba/regex-match-commenter-action/actions/workflows/check-dist.yml) |
6 | 6 | [](https://github.com/zumba/regex-match-commenter-action/actions/workflows/codeql-analysis.yml) |
7 | 7 | [](./badges/coverage.svg) |
8 | 8 |
|
9 | | -This GitHub Action searches for specified regular expression pattern in the changes of a pull request. If matches are found, it can optionally mark the pull request for changes and add inline comments. If no matches are found, a comment is added to the pull request. |
| 9 | +This GitHub Action searches for specified regular expression pattern in the |
| 10 | +changes of a pull request. If matches are found, it can optionally mark the |
| 11 | +pull request for changes and add inline comments. If no matches are found, |
| 12 | +a comment is added to the pull request. |
10 | 13 |
|
11 | | -Some use cases are for detecting PII changes on the code. For example, you can monitor if the words `email`, `phone`, `street`, `password`, etc. are part of the changes. |
12 | | -The match uses regex, so you can also look for variables such as `\w+@\w+.\w+` to look for an actual e-mail address. |
| 14 | +Some use cases are for detecting PII changes on the code. For example, you can |
| 15 | +monitor if the words `email`, `phone`, `street`, `password`, etc. are part of |
| 16 | +the changes. |
| 17 | +The match uses regular expression, so you can also look for variables such as |
| 18 | +`\w+@\w+.\w+` to look for an actual email address. |
13 | 19 |
|
14 | 20 | ## Inputs |
15 | 21 |
|
16 | 22 | ### `github_token` |
17 | 23 |
|
18 | | -**Required** GitHub token for authentication. Typically, this is the GitHub Actions token. |
| 24 | +**Required** GitHub token for authentication. Typically, this is the GitHub |
| 25 | +Actions token. |
19 | 26 |
|
20 | 27 | ### `regex_pattern` |
21 | 28 |
|
22 | | -**Required** A regular expression pattern to search for in the pull request diff. |
| 29 | +**Required** A regular expression pattern to search for in the pull |
| 30 | +request diff. |
23 | 31 |
|
24 | 32 | ### `diff_scope` |
25 | 33 |
|
26 | | -The scope of the diff to search. Can be `added`, `removed`, or `both`. Default is `both`. |
| 34 | +The scope of the diff to search. Can be `added`, `removed`, or `both`. |
| 35 | +Default is `both`. |
27 | 36 |
|
28 | 37 | ### `mark_changes_requested` |
29 | 38 |
|
30 | | -Boolean indicating whether the pull request should be marked as "request changes" if regex matches are found. Default is `false`. |
| 39 | +Boolean indicating whether the pull request should be marked as "request |
| 40 | +changes" if regular expression matches are found. Default is `false`. |
31 | 41 |
|
32 | 42 | ### `match_found_message` |
33 | 43 |
|
34 | | -Custom message for a regex match. This message is used for inline comments on the pull request. Default is `Regex match found.`. |
| 44 | +Custom message for a regular expression match. This message is used for inline |
| 45 | +comments on the pull request. Default is `Regex match found.`. |
35 | 46 |
|
36 | 47 | ### `no_match_found_message` |
37 | 48 |
|
38 | | -Custom message to comment on the pull request when no regex matches are found. Default is `No regex matches found in the diff.` |
| 49 | +Custom message to comment on the pull request when no regular expression |
| 50 | +matches are found. Default is `No regex matches found in the diff.` |
39 | 51 |
|
40 | 52 | ### `changes_requested_message` |
41 | 53 |
|
42 | | -Custom message for marking the pull request as changes requested. Used only if `mark_changes_requested` is `true`. Default is `Changes are requested due to regex match.` |
| 54 | +Custom message for marking the pull request as changes requested. Used only if |
| 55 | +`mark_changes_requested` is `true`. Default is |
| 56 | +`Changes are requested due to regex match.` |
43 | 57 |
|
44 | 58 | ## Usage |
45 | 59 |
|
46 | | -To use this action, create a workflow file (e.g., `.github/workflows/regex-match.yml`) in your repository: |
| 60 | +To use this action, create a workflow file (e.g., |
| 61 | +`.github/workflows/regex-match.yml`) in your repository: |
47 | 62 |
|
48 | 63 | ```yaml |
49 | 64 | name: Regex Match |
|
69 | 84 |
|
70 | 85 | ## Contributing |
71 | 86 |
|
72 | | -Contributions to this action are welcome! Please follow the standard GitHub pull request workflow to submit your changes. |
73 | | -
|
| 87 | +Contributions to this action are welcome! Please follow the standard GitHub |
| 88 | +pull request workflow to submit your changes. |
74 | 89 |
|
75 | 90 | ## Development Setup |
76 | 91 |
|
|
0 commit comments