This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +66
-5
lines changed Expand file tree Collapse file tree 4 files changed +66
-5
lines changed Original file line number Diff line number Diff line change @@ -66,15 +66,23 @@ You can reply to a review comment made by this action and get a response based
66
66
on the diff context. Additionally, you can invite the bot to a conversation by
67
67
tagging it in the comment (` @openai`).
68
68
69
- Examples :
70
-
71
- > @openai Can you please review this block of code?
69
+ Example :
72
70
73
71
> @openai Please generate a test plan for this file.
74
72
75
73
Note : A review comment is a comment made on a diff or a file in the pull
76
74
request.
77
75
76
+ # ## Ignoring PRs
77
+
78
+ Sometimes it is useful to ignore a PR. For example, if you are using this action
79
+ to review documentation, you can ignore PRs that only change the documentation.
80
+ To ignore a PR, add the following keyword in the PR description :
81
+
82
+ ` ` ` text
83
+ @openai: ignore
84
+ ` ` `
85
+
78
86
# ## Screenshots
79
87
80
88

Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ const octokit = new RetryOctokit({auth: `token ${token}`})
18
18
const context = github . context
19
19
const repo = context . repo
20
20
21
+ const ignore_keyword = '@openai: ignore'
22
+
21
23
export const codeReview = async (
22
24
lightBot : Bot ,
23
25
heavyBot : Bot ,
@@ -49,6 +51,19 @@ export const codeReview = async (
49
51
context . payload . pull_request . body
50
52
)
51
53
}
54
+
55
+ // if the description contains ignore_keyword, skip
56
+ if ( inputs . description . includes ( ignore_keyword ) ) {
57
+ core . info ( `Skipped: description contains ignore_keyword` )
58
+ // post a comment to notify the user
59
+ await commenter . comment (
60
+ `Skipped: ignored by the user` ,
61
+ SUMMARIZE_TAG ,
62
+ 'replace'
63
+ )
64
+ return
65
+ }
66
+
52
67
// as gpt-3.5-turbo isn't paying attention to system message, add to inputs for now
53
68
inputs . system_message = options . system_message
54
69
You can’t perform that action at this time.
0 commit comments