https://github.com/google-github-actions/send-google-chat-webhook
A GitHub Action for sending a message to Google Chat via a webhook.
https://github.com/google-github-actions/send-google-chat-webhook
chat google-chat
Last synced: 5 months ago
JSON representation
A GitHub Action for sending a message to Google Chat via a webhook.
- Host: GitHub
- URL: https://github.com/google-github-actions/send-google-chat-webhook
- Owner: google-github-actions
- License: apache-2.0
- Created: 2023-07-19T20:41:53.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-02-01T14:13:10.000Z (8 months ago)
- Last Synced: 2025-04-04T23:33:20.723Z (6 months ago)
- Topics: chat, google-chat
- Language: Go
- Homepage: https://chat.google.com
- Size: 26.4 KB
- Stars: 15
- Watchers: 2
- Forks: 6
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
# send-google-chat-webhook
This github action will enable users to send notification to google chat via github actions.
## Prerequisites
### Obtain a web hook from your google chat workspace.
1. Go to your chat space which you want to add a webhook.
2. At the top, click on the space title, select Apps & Integration.
3. Click Manage webhooks
4. Create a webhook or add another webhook if there is already one.
5. Copy the webhook URL that you intend to use for this github action.For your own security purposes, we would suggest to store your webhook url in github secrets, and use `${{ secrets.WEBHOOK_URL}}` to get it's value.
## Usage
```yaml
jobs:
job_id:
# ...permissions:
contents: 'read'
id-token: 'write'steps:
# ...- id: 'notify_google_chat'
uses: 'google-github-actions/send-google-chat-webhook@v0.0.2'
with:
webhook_url: '${{ secrets.WEBHOOK_URL }}'
mention: ""
```You can customize the condition for when you want this action is called..
```yaml
- id: 'notify google chat'
if: ${{ inputs.fail_intentionally }}
uses: 'google-github-actions/send-google-chat-webhook@v0.0.2'
with:
webhook_url: '${{ secrets.WEBHOOK_URL }}'
mention: ""
```Helpful references:
* Messages and Cards
* [Create, read, update, delete messages](https://developers.google.com/chat/api/guides/crudl/messages)
* [Send a card message](https://developers.google.com/chat/api/guides/message-formats/cards)
* [REST Resource: spaces.messages](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages)
* [Method: spaces.messages.create](https://developers.google.com/chat/api/reference/rest/v1/spaces.messages/create)
* [Cards v2](https://developers.google.com/chat/api/reference/rest/v1/cards)
* abcxyz
* [abcxyz/pkg/cli](https://pkg.go.dev/github.com/abcxyz/pkg/cli)