Skip to content

Commit

Permalink
Infra: Discord hook for failed CVE runs (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
Haarolean authored Jan 3, 2025
1 parent a8811d1 commit 713932a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/cve_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ permissions:
contents: read

jobs:

build-and-test:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -67,3 +68,12 @@ jobs:
image-ref: "ghcr.io/kafbat/kafka-ui:${{ steps.build.outputs.version }}"
format: "table"
exit-code: "1"

notify:
needs: build-and-test
if: ${{ always() && needs.build-and-test.result == 'failure' }}
uses: ./.github/workflows/infra_discord_hook.yml
with:
message: "Attention! CVE checks run failed! Please fix them CVEs :("
secrets:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL_CVE }}
27 changes: 27 additions & 0 deletions .github/workflows/infra_discord_hook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: 'Discord hook'

on:
workflow_call:
inputs:
message:
description: 'Message text'
required: true
type: string
secrets:
DISCORD_WEBHOOK_URL:
required: true

permissions:
contents: read

jobs:

hook:
runs-on: ubuntu-latest
steps:
- name: Notify Discord on Failure
uses: Ilshidur/[email protected]
with:
args: ${{ inputs.message }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}

0 comments on commit 713932a

Please sign in to comment.