github.com/bryan-nice/slack-notification
go get github.com/bryan-nice/slack-notification

github.com/bryan-nice/slack-notification

Git Action Slack Notifications From Build Status

by bryannice

v0.0.0-20210111062339-994ea1036ed0 (see all)License:GPL-3.0
go get github.com/bryan-nice/slack-notification
Readme

Slack Notification

Git Action to send messages to Slack. This action can be used to send message about the status of a Git Action workflow.

Usage

This action can be used after any other action. Below is simple example on using it:

1. Create a .github/workflows/slack-notification.yml

2. Add the following properties to slack-notification.yml file

on: push
name: Slack Notification Demo
jobs:
    slackNotification:
      name: Slack Notification Demo
      runs-on: ubuntu-latest
      steps:
      - uses: actions/checkout@master
      - name: Slack Notification Demo
        uses: bryannice/gitactions-slack-notification@2.0.0
        env:
          SLACK_INCOMING_WEBHOOK: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
          SLACK_MESSAGE: 'Demo''ing the Slack Notification'
          SLACK_TITLE: 'Slack Notification Demo'

Go here for a template yml with all environment variables.

3. Generate Slack WebHook here

4. Encrypt Slack Webhook as a secret in the repo using this app.

Environment Variables

These are the environment variables that can be set to pass in additional information about the Git Action.

Variable NameReguiredDescription
GITHUB_ACTORNoGitHub Actor variable passed from Git Actions.
GITHUB_ACTIONNoGitHub Action name variable passed from Git Actions.
GITHUB_EVENT_NAMENoGitHub Action event name variable passed from Git Actions.
GITHUB_REFNoGitHub reference variable passed from Git Actions.
GITHUB_REPOSITORYNoGitHub Repository variable passed from Git Actions.
GITHUB_WORKFLOWNoGitHub Action workflow varaible passed from Git Actions.
SLACK_CHANNELNoThe Slack channel to use instead of the default.
SLACK_COLORNoFormat color to use for the Slack message.
SLACK_ICONNoThe Slack user icon to use instead of the default.
SLACK_INCOMING_WEBHOOKYesThe Webhook URL generated by Slack to send messages too.
SLACK_MESSAGEYesThe message payload to be sent to Slack.
SLACK_USERNAMENoThe Slack username to use instead of the default.
SLACK_TITLEYesTitle of the Slack message being sent.

Reference

License

GPLv3

GitHub Stars

11

LAST COMMIT

1yr ago

MAINTAINERS

0

CONTRIBUTORS

3

OPEN ISSUES

1

OPEN PRs

1
VersionTagPublished
v0.0.0-20210111062339-994ea1036ed0
10mos ago
v0.0.0-20200712061136-a4ec9e66520d
2yrs ago
v0.0.0-20191113021853-ab5b3adb5539
2yrs ago
v0.0.0-20191111005330-91e39da58f27
2yrs ago
No alternatives found
No tutorials found
Add a tutorial