An open API service indexing awesome lists of open source software.

https://github.com/ironsource/action-slack-notification

A GitHub Action to send a message to a Slack channel.
https://github.com/ironsource/action-slack-notification

actions github-actions slack

Last synced: 2 months ago
JSON representation

A GitHub Action to send a message to a Slack channel.

Awesome Lists containing this project

README

          

# action-slack-notification
A [GitHub Action](https://github.com/features/actions) to send a message to a Slack channel.

## Example usage

Here is an example setup of this action:

```yml
name: Some Action

on:
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest
steps:
...
steps before
...

- name: Slack Notification
uses: AndyKIron/slack-notify@main
with:
channel: some-slack-channel
username: sender-name
message: "tour message here"
slack_webhook: ${{ secrets.SLACK_WEBHOOK }}

...
steps after
...

```

### Inputs (with)

| Variable | | Purpose |
|---------------|----------|------------------------------------------------------------------------------------------------------------------------------------------------|
| channel | required | Slack channel name where you want sending message |
| username | required | Message sender name |
| icon_url | optional | URL to an image to use as the icon for this message. |
| status | optional | Message status (left border color). Values - good (green), warning (yellow), danger (red), or any hex color code (eg. #439FE0). Default - good |
| message | required | Message content like `" :rotating_light: *${{github.actor}}* do some wrong!"` (markdown supported) |
| slack_webhook | required | You can [generate a Slack incoming webhook token from here](https://slack.com/apps/A0F7XDUAZ-incoming-webhooks). |

- Create `SLACK_WEBHOOK` secret using [GitHub Action's Secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets-for-a-repository).