Gitea
Run a Gitea webhook server¶
-
In Gitea create a new user and give it "Reporter" role ("Developer" if using Pro version of the agent) for the intended group or project.
-
For the user from step 1. generate a
personal_access_token
withapi
access. -
Generate a random secret for your app, and save it for later (
webhook_secret
). For example, you can use:
- Clone this repository:
- Prepare variables and secrets. Skip this step if you plan on setting these as environment variables when running the agent:
-
In the configuration file/variables:
- Set
config.git_provider
to "gitea"
- Set
-
In the secrets file/variables:
- Set your AI model key in the respective section
- In the [Gitea] section, set
personal_access_token
(with token from step 2) andwebhook_secret
(with secret from step 3)
-
Build a Docker image for the app and optionally push it to a Docker repository. We'll use Dockerhub as an example:
docker build -f /docker/Dockerfile -t pr-agent:gitea_app --target gitea_app .
docker push codiumai/pr-agent:gitea_webhook # Push to your Docker repository
- Set the environmental variables, the method depends on your docker runtime. Skip this step if you included your secrets/configuration directly in the Docker image.
CONFIG__GIT_PROVIDER=gitea
GITEA__PERSONAL_ACCESS_TOKEN=<personal_access_token>
GITEA__WEBHOOK_SECRET=<webhook_secret>
GITEA__URL=https://gitea.com # Or self host
OPENAI__KEY=<your_openai_api_key>
-
Create a webhook in your Gitea project. Set the URL to
http[s]://<PR_AGENT_HOSTNAME>/api/v1/gitea_webhooks
, the secret token to the generated secret from step 3, and enable the triggerspush
,comments
andmerge request events
. -
Test your installation by opening a merge request or commenting on a merge request using one of PR Agent's commands.