Skip to content
bell

GitHub Action

google-chat-job-failed

v0.3.0 Latest version

google-chat-job-failed

bell

google-chat-job-failed

Sends messages to google chat when a job fails

Installation

Copy and paste the following snippet into your .yml file.

              

- name: google-chat-job-failed

uses: datamole-ai/[email protected]

Learn more about this action in datamole-ai/google-chat-job-failed

Choose a version

google-chat-job-failed

This sends messages to google chat when a workflow job fails.

Usage

This action needs its individual job.

Pass the jobs that you need to track to needs:.

The action takes 2 mandatory variables: gchatURL and json. Leave the json variable as is in the example. This is still a WIP. Add your Google Chat webhook URL to the repo's secrets and send it to the gchatURL variable.

Another optional variable initiator can be passed in to print out who should be responsible for this run. This is espcially useful when the workflow was started by another workflow through a bot.

You can add more conditions to the if: after always(). always() is necessary for the job to run even if the workflow fails.

jobs:
    post-to-google-chat:
        needs: [ job1, job2, job3 ]
        if: always()
        runs-on: ubuntu-latest
        steps:
          - name: google-chat-job-failed
            uses: datamole-ai/google-chat-job-failed@main

            with:
              gchatURL: ${{ secrets.GOOGLE_CHAT_WEBHOOK }}
              json: ${{ toJSON(needs) }}
              # Optional
              initiator: example-user