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

provide additional context for replies #47

Merged
merged 10 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ jobs:

See also: [./action.yml](./action.yml)

### Conversation with OpenAI

You can reply to a review comment made by this action and get a response based
on the diff context. Additionally, you can invite the bot to a conversation by
mentioning it in the beginning of the comment with `@openai`.

Example:

> @openai Can you please review this block of code?

#### Environment variables

- `GITHUB_TOKEN`: This should already be available to the GitHub Action
Expand Down
55 changes: 55 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,61 @@ inputs:
```diff
$patch
```
comment_beginning:
required: false
description: 'Prompt for comment'
default: |
$system_message

A comment was made on a review for a diff patch on file
`$filename`. We will be replying to that. If possible, I
will provide you the file and the entire diff to help
provide overall context.

Reply "OK" to confirm.
comment_file:
required: false
description: 'Prompt for file'
default: |
Here is the content of `$filename` for context.

```
$file_content
```
comment_file_diff:
required: false
description: 'Prompt for file diff'
default: |
Here is the entire diff for `$filename` for context.

```diff
$file_diff
```
comment:
required: false
description: 'Prompt for comment'
default: |
I would like you to reply to the new comment made on
a conversation chain on a code review diff.

diff being commented on:
```diff
${diff}
```

Conversation chain (including the new comment):
```
${comment_chain}
```

Please reply to the new comment in the conversation chain
without extra prose as that reply will be posted as-is.
Make sure to tag the user in your reply. Providing below the
new comment again as reference:
```
${comment}
```

runs:
using: 'node16'
main: 'dist/index.js'
Loading