Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/Ilshidur/action-slack

๐Ÿš€ (Unmaintained) GitHub Action that sends a Slack notification.
https://github.com/Ilshidur/action-slack

github-action github-actions slack

Last synced: 4 months ago
JSON representation

๐Ÿš€ (Unmaintained) GitHub Action that sends a Slack notification.

Awesome Lists containing this project

README

        

# ๐Ÿš€ Slack for GitHub Actions

[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)

[![Build Status][build-badge]][build-url]
![stability-frozen](https://img.shields.io/badge/stability-locked-blue.svg)
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)

Sends a Slack notification. Simple as that.

*Appearance on Slack :*

![Slack message](slack.png "Slack message")

This GitHub action is part of a list of Actions that are located in an other repo. Feel free to check it out : https://github.com/Ilshidur/actions.


## DEPRECATION NOTICE

**Please refer to the following discussion :
https://github.com/Ilshidur/action-slack/discussions/255**

## Usage

```yaml
- name: Slack notification
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: ThisIsMyUsername # Optional. (defaults to webhook app)
SLACK_CHANNEL: general #ย Optional. (defaults to webhook)
SLACK_AVATAR: repository #ย Optional. can be (repository, sender, an URL) (defaults to webhook app avatar)
uses: Ilshidur/[email protected]
with:
args: 'A new commit has been pushed.' #ย Optional
```

**NOTICE :** for stability purposes, it is recommended to use the action with an explicit commit SHA-1 :

* Version : `uses: "Ilshidur/[email protected]"` (โ†’ link to the releases list : https://github.com/Ilshidur/action-slack/releases)
* Commit SHA-1 : `uses: "Ilshidur/action-slack@702accad29cfcfe2ee4ebebb21a3883cc1ac9a39"` (โ†’ link to the commits list : https://github.com/Ilshidur/action-slack/commits/master)

### Arguments

The argument is the message to display in the Slack notification.

**Environment variables** can be interpolated in the message using brackets (`{{` and `}}`) :

e.g.: `Action called : {{ GITHUB_ACTION }}`

*Note :* be careful to properly [format your messages for Slack](https://api.slack.com/docs/message-formatting).

**Event Payload** data can also be interpolated in the message using brackets (`{{` and `}}`) with the `EVENT_PAYLOAD` variable.

e.g.: `Action called: {{ GITHUB_ACTION }} as {{ EVENT_PAYLOAD.pull_request.id }}`

> See the [event types](https://developer.github.com/v3/activity/events/types/) for valid payload informations.

#### Examples

* `args: "Hello, beautiful ! I ran a GitHub Action for you <3"`
* `args: "I showed you my commit. Please respond."`

### Environment variables

* **`SLACK_WEBHOOK`** **(required)**: the Slack webhook URL (see https://api.slack.com/incoming-webhooks).
* **`SLACK_USERNAME`** *(optional)* : overrides username. Defaults to the Slack webhook bot name.
* **`SLACK_CHANNEL`** *(optional)* : overrides the default channel of the webhook. If not set, the message will be sent to the channel associated to the webhook.
* **`SLACK_AVATAR`** *(optional)* : overrides the message avatar. Can be `'repository'`, `'sender'` or an URL. If not set, the avatar of the Slack webhook's bot picture will be used.
* **`SLACK_CUSTOM_PAYLOAD`** *(advanced)* : JSON string that sets full payload. instructions see [CUSTOM_PAYLOAD](CUSTOM_PAYLOAD.md)

## Debugging / testing / development

Developers, all you need is in the [DEVELOPMENT.md](DEVELOPMENT.md) file.

## Contributors



Christhopher Lion

๐Ÿ’ป ๐Ÿค” ๐Ÿ“–

## Alternatives

Because open source is about everyone :

https://github.com/marketplace/actions/post-slack-message

![](https://img.shields.io/github/stars/pullreminders/slack-action.svg?label=Stars&style=social)

https://github.com/marketplace/actions/slack-notify

![](https://img.shields.io/github/stars/rtCamp/action-slack-notify.svg?label=Stars&style=social)

https://github.com/marketplace/actions/slack-bot-action

![](https://img.shields.io/github/stars/krider2010/slack-bot-action.svg?label=Stars&style=social)

https://github.com/marketplace/actions/slatify

![](https://img.shields.io/github/stars/homoluctus/slatify.svg?label=Stars&style=social)

https://github.com/marketplace/actions/slack-notify-build

![](https://img.shields.io/github/stars/voxmedia/github-action-slack-notify-build.svg?label=Stars&style=social)

https://github.com/marketplace/actions/action-slack

![](https://img.shields.io/github/stars/8398a7/action-slack.svg?label=Stars&style=social)



Don't forget to ๐ŸŒŸ Star ๐ŸŒŸ the repo if you like this GitHub Action !

Your feedback is appreciated

[build-badge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2FIlshidur%2Faction-slack%2Fbadge&style=flat
[build-url]: https://actions-badge.atrox.dev/Ilshidur/action-slack/goto