Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add slack notification action #1

Merged
merged 8 commits into from Mar 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 }}"
}
]
}'