Skip to content

Commit

Permalink
Add slack notification action (#1)
Browse files Browse the repository at this point in the history
* Add slack notification action

* [check-spelling] Update metadata

Update for https://github.com/GarnerCorp/build-actions/actions/runs/8191067924/attempts/1
Accepted in #1 (comment)

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
on-behalf-of: @check-spelling <check-spelling-bot@check-spelling.dev>

---------

Signed-off-by: check-spelling-bot <check-spelling-bot@users.noreply.github.com>
  • Loading branch information
Mondlicht1 committed Mar 7, 2024
1 parent 82fa305 commit f7c9573
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions notify-slack/action.yml
@@ -0,0 +1,41 @@
name: 'Slack Notification'
description: 'Send notifications to Slack'
inputs:
slack-webhook:
description: 'Slack webhook URL'
required: true
slack-username:
description: 'Username to display in the message'
required: true
slack-channel:
description: 'Slack channel to post the message'
required: true
title:
description: 'Message title'
required: true
text:
description: 'Message text'
required: true
color:
description: 'Color of the message'
required: false
default: 'good'

runs:
using: composite
steps:
- name: Notify Slack Channel
shell: bash
run: |
curl "${{ inputs.slack-webhook }}" -X POST -H "Content-Type: application/json" \
--data '{
"username": "${{ inputs.slack-username }}",
"channel": "${{ inputs.slack-channel }}",
"attachments": [
{
"title": "${{ inputs.title }}",
"text": "${{ inputs.text }}",
"color": "${{ inputs.color }}"
}
]
}'

0 comments on commit f7c9573

Please sign in to comment.