adding workflow
This commit is contained in:
53
.gitea/workflows/ai-review.yml
Normal file
53
.gitea/workflows/ai-review.yml
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Enterprise AI Code Review
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
|
||||
jobs:
|
||||
ai-review:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
# Checkout the PR repository
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
# Checkout the CENTRAL AI tooling repo
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
repository: Hiddenden/openrabbit
|
||||
path: .ai-review
|
||||
token: ${{ secrets.AI_REVIEW_TOKEN }}
|
||||
|
||||
# Setup Python
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
# Install dependencies
|
||||
- run: pip install requests pyyaml
|
||||
|
||||
# Run the AI review
|
||||
- name: Run Enterprise AI Review
|
||||
env:
|
||||
AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }}
|
||||
AI_REVIEW_REPO: ${{ gitea.repository }}
|
||||
AI_REVIEW_API_URL: https://git.hiddenden.cafe/api/v1
|
||||
AI_REVIEW_PR_NUMBER: ${{ gitea.event.pull_request.number }}
|
||||
|
||||
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
||||
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
|
||||
OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }}
|
||||
run: |
|
||||
cd .ai-review/tools/ai-review
|
||||
python main.py pr ${{ gitea.repository }} ${{ gitea.event.pull_request.number }} \
|
||||
--title "${{ gitea.event.pull_request.title }}"
|
||||
|
||||
# Fail CI on HIGH severity (optional)
|
||||
- name: Check Review Result
|
||||
if: failure()
|
||||
run: |
|
||||
echo "AI Review found HIGH severity issues. Please address them before merging."
|
||||
exit 1
|
||||
Reference in New Issue
Block a user