Skip to content

Commit 06eddbf

Browse files
committed
Fixed some CI/lint checks
1 parent c24069e commit 06eddbf

File tree

5 files changed

+32
-41
lines changed

5 files changed

+32
-41
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ jobs:
5555
id: test-action
5656
uses: ./
5757
with:
58-
milliseconds: 2000
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
regex_pattern: 'testing'
5960

60-
- name: Print Output
61-
id: output
62-
run: echo "${{ steps.test-action.outputs.time }}"

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,64 @@
1-
# Regex Match Commenter Action
1+
# Regular Expression Match Commenter Action
22

33
[![GitHub Super-Linter](https://github.com/zumba/regex-match-commenter-action/actions/workflows/linter.yml/badge.svg)](https://github.com/super-linter/super-linter)
44
![CI](https://github.com/zumba/regex-match-commenter-action/actions/workflows/ci.yml/badge.svg)
55
[![Check dist/](https://github.com/zumba/regex-match-commenter-action/actions/workflows/check-dist.yml/badge.svg)](https://github.com/zumba/regex-match-commenter-action/actions/workflows/check-dist.yml)
66
[![CodeQL](https://github.com/zumba/regex-match-commenter-action/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/zumba/regex-match-commenter-action/actions/workflows/codeql-analysis.yml)
77
[![Coverage](./badges/coverage.svg)](./badges/coverage.svg)
88

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

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

1420
## Inputs
1521

1622
### `github_token`
1723

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

2027
### `regex_pattern`
2128

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

2432
### `diff_scope`
2533

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

2837
### `mark_changes_requested`
2938

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

3242
### `match_found_message`
3343

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

3647
### `no_match_found_message`
3748

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

4052
### `changes_requested_message`
4153

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

4458
## Usage
4559

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:
4762

4863
```yaml
4964
name: Regex Match
@@ -69,8 +84,8 @@ jobs:
6984
7085
## Contributing
7186
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.
7489
7590
## Development Setup
7691

badges/coverage.svg

Lines changed: 1 addition & 1 deletion
Loading

dist/index.js

Lines changed: 0 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,6 @@ export async function run(): Promise<void> {
109109
core.debug(`Match found`)
110110
foundMatches = true
111111
const side = line.startsWith('+') ? 'RIGHT' : 'LEFT'
112-
const requestParams = {
113-
owner,
114-
repo,
115-
pull_number: pullRequestNumber,
116-
body: matchFoundMessage,
117-
commit_id: context.payload.pull_request.head.sha,
118-
path: currentFile,
119-
side,
120-
line: side === 'LEFT' ? oldLineNumber : newLineNumber
121-
}
122-
core.debug(JSON.stringify(requestParams))
123112

124113
await octokit.rest.pulls.createReviewComment({
125114
owner,

0 commit comments

Comments
 (0)