Files
reviewer/docs/develoepr-guide/how-to-integrate.md
2026-03-12 12:03:22 +07:00

1.9 KiB

CI/CD integration for Gitea VCS

Introduction

Manually launching and configuring the tool is quite a challenging task and requires a deep understanding of the AI service being used and the built-in operating rules. Therefore, to simplify the task, we have created pre-prepared actions for launching and updating the tool.

1. User for review

For the tool to work, you need to add a user who will perform the review. Add to CODEOWNERS file for repository if you want it to be assigned automatically, or add it manually if necessary.

Use this Gitea user by default: @kodobot.

2. Prepared step script for Gitea

Use the following script to integrate the tool into your Gitea actions. All necessary improvements and integrations must be performed independently by each team. Add your .gitea/workflows/kodo-reviewer.yaml file with the following content

name: AI Code Reviewer Assistant for Gitea
on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  claude-assistant:
    runs-on: kodo-review
    steps:
      - name: Run AI Code Reviewer
        uses: https://code.wynenterprise.io/kodo/reviewer@main
        with:
          gitea_token: ${{ secrets.CC_GITEATOKEN }}
          anthropic_api_key: ${{ secrets.CC_API_KEY }}

This script will run automatically when a Pull Request is created or updated. If necessary, you can start it manually via the Gitea interface and add additional conditions required for start.

2.1. Environment variables for script

When configuring the tool, always strictly adhere to the following rules for certain environment variables:

  1. The secrets.CC_GITEATOKEN environment variable must contain a token for the user @kodobot. Request this token from the devops team.
  2. The secrets.CC_API_KEY environment variable must contain a token for access ti AI model. Request this token from the devops team.