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 all 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
38 changes: 38 additions & 0 deletions docs/webhooks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,44 @@ GitLab
* Leave the default **Push events** selected and mark **Tag push events** also
* Finish by clicking **Add Webhook**

Gitea
~~~~~

These instructions apply to any Gitea instance.

.. 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.
See `issue #8364`_ for more details. Official support may be implemented in the future.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Official support may be implemented in the future.

I'm not sure that decision has been made.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"may" or "may not", I don't think this paragraph conveys any certain decision?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it gives a "false hope", I don't see us adding another service like gitea, but implementing another solution like having a more configurable webhook processing instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sorry the sentence sounds as a promise, it wasn't meant to be. I was trying to address this comment by @humitos. Feel free to remove it or rephrase it of course!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, this might need some input from @ericholscher or @agjohnson if we actually want to add this to our roadmap.


On Read the Docs:

* Manually create a "GitHub webhook" integration
(this will show a warning about the webhook not being correctly set up,
that will go away when the webhook is configured in Gitea)

On your Gitea instance:

* 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`

Finally, on Read the Docs, check that the warnings have disappeared
and the delivery test triggered a build.

.. _issue #8364: https://github.com/readthedocs/readthedocs.org/issues/8364

.. _webhook-integration-generic:

Using the generic API integration
Expand Down