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

Commit e09dde1

Browse files
authored
all: Code Review
1 parent 790ffee commit e09dde1

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

.github/workflows/test-action.yml

+13-24
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
1-
on: [pull_request]
1+
name: GPTReviewWorkflow
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
28

39
jobs:
4-
add_pr_comment:
5-
permissions: write-all
10+
review_with_gpt:
611
runs-on: ubuntu-latest
7-
name: OpenAI PR Comment
12+
813
steps:
9-
- uses: actions/checkout@v3
10-
with:
11-
ref: ${{ github.event.pull_request.head.sha }}
12-
fetch-depth: 2
13-
- id: patch
14-
run: |
15-
patch_output=$(curl --silent --request GET \
16-
--url https://api.github.com/repos/$PATCH_REPO/pulls/$PATCH_PR \
17-
--header "Accept: application/vnd.github.v3.patch" \
18-
--header "Authorization: Bearer $PATCH_GITHUB_TOKEN")
19-
echo $patch_output
20-
echo "GIT_PATCH_OUTPUT=$(echo $patch_output)" >> $GITHUB_ENV
21-
env:
22-
PATCH_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23-
PATCH_PR: ${{ github.event.pull_request.number }}
24-
PATCH_REPO: ${{ github.repository }}
25-
- id: review
26-
uses: MXCzkEVM/GPTReviewWorkflow@main
14+
- name: GPTReviewWorkflow
15+
uses: sheenhx/GPT4ReviewWorkflow@main
2716
with:
2817
GIT_COMMIT_HASH: ${{ github.event.pull_request.head.sha }}
29-
GIT_PATCH_OUTPUT: ${{ env.GIT_PATCH_OUTPUT }}
30-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
GIT_PATCH_OUTPUT: ${{ github.event.pull_request.patch_url }}
19+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
3120
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
3221
OPENAI_ORG_KEY: ${{ secrets.OPENAI_ORG_KEY }}
3322
PR_NUMBER: ${{ github.event.pull_request.number }}

0 commit comments

Comments
 (0)