GitHub Action: datadog-notify
Create Datadog Notify Event
Introduction
This repository contains the action for sending an event to datadog.
Usage
Minimal Usage:
- name: Notify Datadog
uses: cloudposse/github-action-datadog-notify@main
with:
api_key: ## ${{ env.DATADOG_API_KEY }} ## ${{secrets.DATADOG_API_KEY}}
title: "GitHub Action: ${{ github.event_name }}"
text: "GitHub Action: ${{ github.event_name }}"
tags: "source:github,repo:${{ github.repository }},event:${{ github.event_name }}"
alert_type: "info"
Below is a snippet that will send an event to datadog when a pull request is sync'd.
Below uses the dkershner6/aws-ssm-getparameters-action
to get the datadog api key from ssm.
name: Datadog Notify
on:
workflow_dispatch:
pull_request:
branches:
- 'main'
permissions:
contents: read
pull-requests: write
id-token: write
jobs:
datadog-notify:
runs-on: ["self-hosted"]
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
role-session-name: "gha-datadog-notify"
aws-region: "us-east-1"
- uses: dkershner6/aws-ssm-getparameters-action@v1
with:
parameterPairs: "/datadog/datadog_api_key = DATADOG_API_KEY"
- name: Notify Datadog
uses: cloudposse/github-action-datadog-notify@main
with:
api_key: ${{ env.DATADOG_API_KEY }}
title: "GitHub Action: ${{ github.event_name }}"
text: "GitHub Action: ${{ github.event_name }}"
tags: "source:github,repo:${{ github.repository }},event:${{ github.event_name }}"
alert_type: "info"
Inputs
Name | Description | Default | Required |
---|---|---|---|
alert_type | Type of the event, one of: error,warning,info,success,user_update,recommendation,snapshot | info | true |
api_key | Datadog API Key | N/A | true |
append_hostname_tag | Should we append the hostname as a tag to the event, set this to the key of the tag | false | |
tags | Space separated list of Tags for the event | N/A | true |
text | Description of the event | N/A | true |
title | Title of the event | N/A | true |
Outputs
Name | Description |
---|