First, create the stream you'd like to use for Gogs notifications, and then
subscribe all interested parties to this stream. The integration will use
the default stream commits
if no stream is supplied in the
hook; you still need to
create the stream
even if you are using this default.
Next, go to your repository page and click Settings:
On the Settings page, select the Webhooks link on the left sidebar:
Click the Add Webhook button and then select the Gogs option from the dropdown that appears.
Authorize yourself and configure your webhook.
In the Payload URL field, enter a URL in the format of:
{{ external_api_uri_subdomain }}/v1/external/gogs?api_key=abcdefgh&stream=gogs
where api_key
is the API key of your Zulip bot.
You can also limit the notifications you receive to specific branches by specifying them in a comma-separated list at the end of the URL, like so:
{{ external_api_uri_subdomain }}/v1/external/gogs?api_key=abcdefgh&stream=gogs&branches=master,development
Then, set Content type to application/json
.
Next, select the events that you want to trigger Zulip notifications. After you have selected all the desired events, click the Add Webhook button.
Congratulations! You're done!
Your messages will look like this: