Skip to content

Add documentation about webhooks for Gitea #8402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 16, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/webhooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,34 @@ GitLab
* Leave the default **Push events** selected and mark **Tag push events** also
* Finish by clicking **Add Webhook**

Gitea
~~~~~

.. warning::

This isn't officially supported, but using the "GitHub webhook" is an effective workaround,
because Gitea uses the same payload as GitHub. The generic webhook is not compatibile with Gitea.

* Manually create a "GitHub webhook" integration on Read the Docs
(this will show a warning about the webhook not being correctly set up,
that will go away when the webhook is configured in Gitea)
* Go to the :guilabel:`Settings` > :guilabel:`Webhooks` page for your project on your Gitea instance
* Create a new webhook of type "Gitea"
* For **URL**, use the URL of the integration on Read the Docs,
found on the :guilabel:`Admin` > :guilabel:`Integrations` page
* Leave the default **HTTP Method** as POST
* For **Content type**, both *application/json* and
*application/x-www-form-urlencoded* work
* Leave the **Secret** field blank
* Select **Choose events**,
and mark **Branch or tag creation**, **Branch or tag deletion** and **Push** events
* Ensure **Active** is enabled; it is by default
* Finish by clicking **Add Webhook**
* Test the webhook with :guilabel:`Delivery test`
* On Read the Docs, check that the warnings have disappeared and the delivery test triggered a build

These instructions apply to any Gitea instance.

.. _webhook-integration-generic:

Using the generic API integration
Expand Down