First, you need to get a webhook URL from google chat, which can be done with the following steps:
- Go into a room in Google Chat, click the name, and click manage webhooks
- Once you do that, you should be taken to the make a webhook screen right away, but if not click 'Add Another'
- Enter a name (presumably GitHub) and optional avatar url then click 'Save'
- When you are back at the manage webhooks screen, click the copy icon next to your webhook
- Open the page for the repo you want to link to google chat, and open the settings tab.
- Click on 'Webhooks' on the sidebar to the left
- Click 'Add Webhook' (to the right)
- Under payload url, type
https://github-to-google-chat.vercel.app/?url=
- Paste in the Webhook url from google chat, so the payload URL looks like this:
https://github-to-google-chat.vercel.app/?url={Google Chat Webhook URL}
- Set the content type to
application/json
- Choose the events you would like to be notified about, and then click 'Add Webhook'
IMPORTANT NOTE: Currently, only some events have a custom message. These events are:
- Pull Requests
- Pushes
- Issues
Everything else will use the default message, seen below.
If all goes well, you should see a message like this in google chat: