All Projects → rtCamp → Action Slack Notify

rtCamp / Action Slack Notify

Licence: mit
GitHub Action for sending a notification to a Slack channel

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to Action Slack Notify

Python Slack Sdk
Slack Developer Kit for Python
Stars: ✭ 3,307 (+761.2%)
Mutual labels:  slack
Slack
Slack API in Go - community-maintained fork created by the original author, @nlopes
Stars: ✭ 3,744 (+875%)
Mutual labels:  slack
Pokemongo Bot
The Pokemon Go Bot, baking with community.
Stars: ✭ 3,730 (+871.35%)
Mutual labels:  slack
Action Slack
Provides the function of slack notification to GitHub Actions.
Stars: ✭ 310 (-19.27%)
Mutual labels:  slack
Slack Cleaner
delete slack messages and files. An improved version is at:
Stars: ✭ 329 (-14.32%)
Mutual labels:  slack
Intelligo
🤖 Chatbot Framework for Node.js.
Stars: ✭ 347 (-9.64%)
Mutual labels:  slack
Phanbook
A Q&A and Forum PHP platform
Stars: ✭ 294 (-23.44%)
Mutual labels:  slack
Slackapidoc
Documentation of undocumented Slack API methods
Stars: ✭ 380 (-1.04%)
Mutual labels:  slack
Themer Gui
A graphical UI for themer. Replaced by Progressive Web App at https://themer.dev.
Stars: ✭ 337 (-12.24%)
Mutual labels:  slack
Slackistrano
Slack integration for Capistrano deployments.
Stars: ✭ 370 (-3.65%)
Mutual labels:  slack
Kube Slack
Kubernetes Slack Monitoring
Stars: ✭ 321 (-16.41%)
Mutual labels:  slack
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (-15.62%)
Mutual labels:  slack
Tfnotify
A CLI command to parse Terraform execution result and notify it to GitHub
Stars: ✭ 353 (-8.07%)
Mutual labels:  slack
Yetibot
🤖 Extreme chatops bot for Slack and IRC 🔧 New contributors welcome 🏗
Stars: ✭ 311 (-19.01%)
Mutual labels:  slack
Partyparrot
🎉 🐦 Very Serious Code ™️ that generates huge slack messages with emojis.
Stars: ✭ 374 (-2.6%)
Mutual labels:  slack
Slack Emojinator
Bulk upload emoji into Slack
Stars: ✭ 296 (-22.92%)
Mutual labels:  slack
Chronos
📊 📊 📊 Monitors the health and web traffic of servers, microservices, and containers with real-time data monitoring and receive automated notifications over Slack or email.
Stars: ✭ 347 (-9.64%)
Mutual labels:  slack
Matterbridge
bridge between mattermost, IRC, gitter, xmpp, slack, discord, telegram, rocketchat, twitch, ssh-chat, zulip, whatsapp, keybase, matrix, microsoft teams, nextcloud, mumble, vk and more with REST API (mattermost not required!)
Stars: ✭ 4,452 (+1059.38%)
Mutual labels:  slack
Repl
The Learning Hub for UoL's Online CS Students
Stars: ✭ 367 (-4.43%)
Mutual labels:  slack
Bottender
⚡️ A framework for building conversational user interfaces.
Stars: ✭ 3,803 (+890.36%)
Mutual labels:  slack

This action is a part of GitHub Actions Library created by rtCamp.

Slack Notify - GitHub Action

Project Status: Active – The project has reached a stable, usable state and is being actively developed.

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

Screenshot

action-slack-notify-rtcamp

The Site and SSH Host details are only available if this action is run after Deploy WordPress GitHub action.

Usage

You can use this action after any other action. Here is an example setup of this action:

  1. Create a .github/workflows/slack-notify.yml file in your GitHub repo.
  2. Add the following code to the slack-notify.yml file.
on: push
name: Slack Notification Demo
jobs:
  slackNotification:
    name: Slack Notification
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - name: Slack Notification
      uses: rtCamp/[email protected]
      env:
        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
  1. Create SLACK_WEBHOOK secret using GitHub Action's Secret. You can generate a Slack incoming webhook token from here.

Environment Variables

By default, action is designed to run with minimal configuration but you can alter Slack notification using following environment variables:

Variable Default Purpose
SLACK_CHANNEL Set during Slack webhook creation Specify Slack channel in which message needs to be sent
SLACK_USERNAME rtBot Custom Slack Username sending the message. Does not need to be a "real" username.
SLACK_MSG_AUTHOR $GITHUB_ACTOR (The person who triggered action). GitHub username of the person who has triggered the action. In case you want to modify it, please specify corrent GitHub username.
SLACK_ICON rtBot Avatar User/Bot icon shown with Slack message. It uses the URL supplied to this env variable to display the icon in slack message.
SLACK_ICON_EMOJI - User/Bot icon shown with Slack message, in case you do not wish to add a URL for slack icon as above, you can set slack emoji in this env variable. Example value: 🔔 or any other valid slack emoji.
SLACK_COLOR good (green) You can pass ${{job.status}} for automatic coloring or an RGB value like #efefef which would change color on left side vertical line of Slack message.
SLACK_MESSAGE Generated from git commit message. The main Slack message in attachment. It is advised not to override this.
SLACK_TITLE Message Title to use before main Slack message.
SLACK_FOOTER Powered By rtCamp's GitHub Actions Library Slack message footer.
MSG_MINIMAL - If set to true, removes: Ref, Event, Actions URL and Commit from the message. You can optionally whitelist any of these 4 removed values by passing it comma separated to the variable instead of true. (ex: MSG_MINIMAL: event or MSG_MINIMAL: ref,actions url, etc.)

You can see the action block with all variables as below:

    - name: Slack Notification
      uses: rtCamp/[email protected]
      env:
        SLACK_CHANNEL: general
        SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
        SLACK_ICON: https://github.com/rtCamp.png?size=48
        SLACK_MESSAGE: 'Post Content 🚀'
        SLACK_TITLE: Post Title
        SLACK_USERNAME: rtCamp
        SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

Below screenshot help you visualize message part controlled by different variables:

Screenshot_2019-03-26_at_5_56_05_PM

The Site and SSH Host details are only available if this action is run after Deploy WordPress GitHub action.

Hashicorp Vault (Optional)

This GitHub action supports Hashicorp Vault.

To enable Hashicorp Vault support, please define following GitHub secrets:

Variable Purpose Example Vaule
VAULT_ADDR Vault server address https://example.com:8200
VAULT_TOKEN Vault token s.gIX5MKov9TUp7iiIqhrP1HgN

You will need to change secrets line in slack-notify.yml file to look like below.

on: push
name: Slack Notification Demo
jobs:
  slackNotification:
    name: Slack Notification
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - name: Slack Notification
      uses: rtCamp/[email protected]
      env:
        VAULT_ADDR: ${{ secrets.VAULT_ADDR }}
        VAULT_TOKEN: ${{ secrets.VAULT_TOKEN }}

GitHub action uses VAULT_TOKEN to connect to VAULT_ADDR to retrieve slack webhook from Vault.

In the Vault, the Slack webhook should be setup as field webhook on path secret/slack.

License

MIT © 2019 rtCamp

Does this interest you?

Join us at rtCamp, we specialize in providing high performance enterprise WordPress solutions

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].