Files
AegisGitea-MCP/.gitea/workflows/ai-chat.yml
Workflow config file is invalid. Please check your config file: yaml: unmarshal errors: line 40: cannot unmarshal !!map into string
latte 5b4495a0a9
Some checks failed
lint / lint (push) Successful in 23s
test / test (push) Failing after 19s
updaAdd AI review workflowste
2026-02-27 19:47:54 +01:00

62 lines
2.9 KiB
YAML

name: AI Chat ({{BOT_USERNAME}})
# WORKFLOW ROUTING:
# This workflow handles FREE-FORM questions/chat (no specific command)
# Other workflows: ai-issue-triage.yml (@{{BOT_NAME}} triage), ai-comment-reply.yml (specific commands)
# This is the FALLBACK for any @{{BOT_NAME}} mention that isn't a known command
on:
issue_comment:
types: [created]
# CUSTOMIZE YOUR BOT NAME:
# Change '@{{BOT_NAME}}' in all conditions below to match your config.yml mention_prefix
# Examples: '@bartender', '@uni', '@joey', '@codebot'
jobs:
ai-chat:
# Only run if comment mentions the bot but NOT a specific command
# This prevents duplicate runs with ai-comment-reply.yml and ai-issue-triage.yml
# CRITICAL: Ignore bot's own comments to prevent infinite loops (bot username: {{BOT_USERNAME}})
if: |
{{PLATFORM}}.event.comment.user.login != '{{BOT_USERNAME}}' &&
contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}}') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} triage') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} help') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} explain') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} suggest') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} security') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} summarize') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} changelog') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} explain-diff') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} review-again') &&
!contains({{PLATFORM}}.event.comment.body, '@{{BOT_NAME}} setup-labels')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: {{OPENRABBIT_REPO}}
path: .ai-review
token: ${{ secrets.AI_REVIEW_TOKEN }}
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install requests pyyaml
- name: Run AI Chat
env:
AI_REVIEW_TOKEN: ${{ secrets.AI_REVIEW_TOKEN }}
AI_REVIEW_REPO: ${{ {{PLATFORM}}.repository }}
AI_REVIEW_API_URL: {{API_URL}}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
OLLAMA_HOST: ${{ secrets.OLLAMA_HOST }}
SEARXNG_URL: ${{ secrets.SEARXNG_URL }}
run: |
cd .ai-review/tools/ai-review
python main.py comment ${{ {{PLATFORM}}.repository }} ${{ {{PLATFORM}}.event.issue.number }} "${{ {{PLATFORM}}.event.comment.body }}"