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

Commit 1b5cf99

Browse files
authored
Reply to user comments (#42)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI New Feature: Users can now reply to specific comments made on the review. This feature improves the user experience by allowing them to address specific issues raised in the review. The changes include updates to `.github/workflows/chatgpt-review.yml`, `src/commenter.ts`, `src/main.ts`, and `src/review-comment.ts` files to handle pull request review comments. <!-- end of auto-generated comment: release notes by openai -->
1 parent 154848a commit 1b5cf99

File tree

6 files changed

+818
-550
lines changed

6 files changed

+818
-550
lines changed

.github/workflows/chatgpt-review.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ permissions:
44
contents: read
55
pull-requests: write
66

7-
on:
8-
pull_request_target:
7+
on: [pull_request, pull_request_review_comment]
98

109
concurrency:
11-
group: ${{ github.repository }}-${{ github.event.number || github.head_ref || github.sha }}-${{ github.workflow }}
12-
cancel-in-progress: true
10+
group:
11+
${{ github.repository }}-${{ github.event.number || github.head_ref ||
12+
github.sha }}-${{ github.workflow }}-${{ github.event_name ==
13+
'pull_request_review_comment' && 'pr_comment' || 'pr' }}
14+
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}
1315

1416
jobs:
1517
chatgpt:

README.md

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ prompts have been tuned for a concise response. To prevent excessive
1010
notifications, this action can be configured to skip adding review comments when
1111
the changes look good for the most part.
1212

13+
In addition, this action can also reply to the user comments made on the review
14+
by this action.
15+
1316
NOTES:
1417

1518
- Your code (files, diff, PR title/description) will be sent to OpenAI's servers
@@ -20,20 +23,6 @@ NOTES:
2023
[more conservative data usage policy](https://openai.com/policies/api-data-usage-policies)
2124
compared to their ChatGPT offering.
2225

23-
### Features
24-
25-
- Code review your pull requests
26-
27-
```yaml
28-
- uses: fluxninja/openai-pr-reviewer@main
29-
env:
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
32-
with:
33-
debug: false
34-
review_comment_lgtm: false
35-
```
36-
3726
## Usage
3827

3928
```yaml
@@ -43,25 +32,26 @@ permissions:
4332
contents: read
4433
pull-requests: write
4534

46-
on:
47-
pull_request:
35+
on: [pull_request, pull_request_review_comment]
36+
37+
concurrency:
38+
group:
39+
${{ github.repository }}-${{ github.event.number || github.head_ref ||
40+
github.sha }}-${{ github.workflow }}-${{ github.event_name ==
41+
'pull_request_review_comment' && 'pr_comment' || 'pr' }}
42+
cancel-in-progress: ${{ github.event_name != 'pull_request_review_comment' }}
4843

4944
jobs:
5045
test:
5146
runs-on: ubuntu-latest
5247
steps:
53-
- uses: actions/checkout@v3
54-
with:
55-
repository: ${{github.event.pull_request.head.repo.full_name}}
56-
ref: ${{github.event.pull_request.head.ref}}
57-
submodules: false
5848
- uses: fluxninja/openai-pr-reviewer@main
5949
env:
6050
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6151
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
6252
with:
6353
debug: false
64-
review_comment_lgtm: true
54+
review_comment_lgtm: false
6555
```
6656
6757
### Screenshots
@@ -142,12 +132,6 @@ jobs:
142132
test:
143133
runs-on: ubuntu-latest
144134
steps:
145-
- uses: actions/checkout@v3
146-
with:
147-
repository: ${{github.event.pull_request.head.repo.full_name}}
148-
ref: ${{github.event.pull_request.head.ref}}
149-
submodules: false
150-
151135
- uses: fluxninja/openai-pr-reviewer@main
152136
env:
153137
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)