Skip to content

Commit

Permalink
try using composite action
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 committed Mar 13, 2024
1 parent 0a8f77f commit a943105
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/CI_send_failure_event.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: "Send failure event to Datadog"
inputs:
api-key:
description: "Datadog API key"
required: true
runs:
using: "composite"
steps:
- uses: masci/datadog@v1
with:
api-key: ${{ inputs.api-key }}
api-url: https://api.datadoghq.eu
events: |
- title: "core-integrations nightly failure: ${{ github.workflow }}"
text: "Job ${{ github.job }} in branch ${{ github.ref_name }}"
alert_type: "error"
source_type_name: "Github"
host: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- "job:${{ github.job }}"
- "run_id:${{ github.run_id }}"
- "workflow:${{ github.workflow }}"
- "branch:${{ github.ref_name }}"
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
22 changes: 5 additions & 17 deletions .github/workflows/fastembed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,9 @@ jobs:
run: hatch run cov

- name: Send failure event to Datadog
if: failure()
uses: masci/datadog@v1
# we want to send a failure event to Datadog and notify the team
# only if the job fails during scheduled nightly runs
if: failure() #github.event_name == 'schedule' &&
uses: ./.github/workflows/CI_send_failure_event.yml
with:
api-key: ${{ secrets.CORE_DATADOG_API_KEY }}
api-url: https://api.datadoghq.eu
events: |
- title: "core-integrations nightly failure: ${{ github.workflow }}"
text: "Job ${{ github.job }} in branch ${{ github.ref_name }}"
alert_type: "error"
source_type_name: "Github"
host: ${{ github.repository_owner }}
tags:
- "project:${{ github.repository }}"
- "job:${{ github.job }}"
- "run_id:${{ github.run_id }}"
- "workflow:${{ github.workflow }}"
- "branch:${{ github.ref_name }}"
- "url:https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
api-key: ${{ secrets.DATADOG_API_KEY }}

0 comments on commit a943105

Please sign in to comment.