Skip to content

Notify when service becomes unhealthy #4

Notify when service becomes unhealthy

Notify when service becomes unhealthy #4

name: Notify when service becomes unhealthy
on:
workflow_dispatch:
inputs:
# Note that the input is the same as the payload (workflowInputs) defined in the automation
service_name:
description: "The unhealthy service's name"
required: true
type: string
jobs:
send_logsnag_notification:
runs-on: ubuntu-latest
steps:
- name: Send LogSnag notification
env:
LOGSNAG_API_TOKEN: "0e8694b5b0572d3a59f974686773a072"
run: |
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ${{ env.LOGSNAG_API_TOKEN }}' \
--data '{
"project":"playground",
"channel":"idp-port",
"event":"Project Unhealthy",
"description":"The service ${{ inputs.service_name }} has become unhealthy",
"icon":"🚢",
"notify":true
}' \
https://api.logsnag.com/v1/log