Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Invite bot #45

Merged
merged 3 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/review-comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ const token = core.getInput('token')
const octokit = new Octokit({auth: `token ${token}`})
const context = github.context
const repo = context.repo
const BOT_INVITE = '@openai'

export const handleReviewComment = async (bot: Bot) => {
const commenter: Commenter = new Commenter()
Expand Down Expand Up @@ -50,7 +51,11 @@ export const handleReviewComment = async (bot: Bot) => {
comment
)
// check whether this chain contains replies from the bot
if (chain.includes(COMMENT_TAG) || chain.includes(COMMENT_REPLY_TAG)) {
if (
chain.includes(COMMENT_TAG) ||
chain.includes(COMMENT_REPLY_TAG) ||
comment.body.startsWith(BOT_INVITE)
) {
const prompt = `I would like you to reply to the new comment made on a conversation chain on a code review diff.

Diff:
Expand Down