Creating webhooks
For manually-created Control repositories, you must create a webhook so that Code Genie can detect pull request activity and trigger automated scans and reviews
Before you begin
Before you begin, ensure that you have:
- Administrator access to the Control repository in Gitea.
- Created a Control repository manually.
- Read Code Genie documentation.
- Confirmed that the Code Genie service is running and accessible from the Gitea server's network.
About this task
A webhook is an HTTP callback that Gitea triggers automatically when repository events occur. When an event matches your configured trigger, Gitea sends a POST request with a JSON payload to the Code Genie target URL. You can filter triggers by event type and branch pattern, giving you precise control over which pull request activities notify Code Genie.
Procedure
-
Navigate to your Control repository in Gitea and click
Settings.

- In the left navigation panel, click Webhooks under Settings.
-
Click Add Webhook and select
Gitea from the drop-down list.

-
Configure the webhook with the following values.
- Target URL: http://devops-code-container-mgr:3005/api/pull-request
- HTTP Method: POST
- POST Content Type:
application/json
- Under Trigger On, select Custom Events.
-
In the Pull Request Events section, select the following
check boxes.
- Pull Request — fires when a pull request is opened, closed, reopened, or edited.
- Pull Request Synchronized — fires when new commits are pushed to an open pull request.
-
In the Branch Filter field, enter
*to apply the webhook to all branches.To restrict to specific branches, use a glob pattern such asmasteror{master,release*}. - Click Add Webhook to save the configuration.
- Confirm that the webhook appears in the Webhooks list with a green status indicator.
Results
You have created a webhook on the Control repository. Gitea will now send a POST request to Code Genie each time a pull request is opened or synchronized on the repository.
What to do next
After creating the webhook, you must complete the remaining manual configuration steps before Code Genie can scan pull requests:
- Configure branch protection rules for the main branch.
- Create the .devops-loop/code-config.jsonc file in the Control repository to enable Trivy scanning.