Skip to content

Commit d0378d6

Browse files
author
Jakub Jirous
committed
[github] code review using open api
[github] code review using open api [github] code review using open api
1 parent b2cb8a8 commit d0378d6

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

.github/workflows/code_review.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Code Review Workflow"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
code-review:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: "Fetch pull request information"
14+
id: pr-info
15+
uses: actions/github-script@v3
16+
with:
17+
github-token: ${{ secrets.GH_TOKEN }}
18+
script: |
19+
const pr = context.payload.pull_request;
20+
console.log(` Pull request information: ${JSON.stringify(pr)}`);
21+
22+
- name: "Run OpenAI code review"
23+
id: code-review
24+
uses: openai/action-chat-gpt@v1
25+
with:
26+
prompt: "Please provide a code review of the following Pull Request: ${{ steps.pr-info.outputs.pull_request }}"
27+
model: text-davinci-002
28+
api_key: ${{ secrets.OPENAI_API_KEY }}

.github/workflows/sonarcloud.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ name: "SonarCloud"
22

33
on:
44
push:
5-
branches: ["main"]
5+
branches:
6+
- main
67

78
pull_request:
8-
branches: ["main"]
9+
branches:
10+
- main
911

1012
workflow_dispatch:
1113

0 commit comments

Comments
 (0)