impl_code_review #1

Merged
mschoi merged 3 commits from impl_code_review into main 2024-12-31 00:47:38 +09:00
4 changed files with 61 additions and 12 deletions

32
.github/workflows/code-review.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: Code Review
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests py-gitea
- name: Run Code Review
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
run: python .github/scripts/code_review.py

21
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Test action
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Run Code Review
run: python .github/scripts/test.py

View File

@@ -1,12 +0,0 @@
steps:
print_branch:
image: alpine:latest
secrets:
- OPENAI_API
commands:
- |
echo "Current branch: ${CI_COMMIT_BRANCH}"
echo "OPENAI_API: ${OPENAI_API}"
when:
event: [push, pull_request]
branch: main

8
test.py Normal file
View File

@@ -0,0 +1,8 @@
from gitea import Gitea
g = Gitea(
"https://git.teahaven.kr",
"735a1106653ce9a63ca80667f32e93221427fecc",
)