/slack-notify-action

Post inspirational messages to slack channel

Primary LanguageJavaScriptMIT LicenseMIT

slack-inspire-action

Sends inspirational quotes to a slack channel

Prerequisites

Usage

  1. Create a new slack app.

  2. Configure it by giving it a name, icon, etc

  3. Create/Generate a token see here - https://slack.com/intl/en-cm/help/articles/215770388-Create-and-regenerate-API-tokens

  4. Add the following to your workflow

name: Inspire Slack
on:
  push:
    branches: [ master ]
jobs:
  build:
    name: Inspire
    runs-on: ubuntu-latest
    steps:
      - uses: muarachmann/slack-notify-action@master
        with:
          SLACK_CLIENT_TOKEN: ${{ secrets.SLACK_CLIENT_TOKEN }}
          CHANNEL_ID: ${{ secrets.CHANNEL_ID }}

Inputs

SLACK_CLIENT_TOKEN

Required This token is needed for authentication of your slack bot. Usually starts with xoxb-XXXXXX-XXXXXXX-XXXXXX

NB SLACK_CLIENT_TOKEN needs to have scope to send messages like: chat:write, chat:write.public, groups:write

CHANNEL_ID

Required This is the channel that the bot is going to post to e.g general, random etc. NB This is the same channel the app must be invited to and installed

Testing

For testing locally, run the following commands cp .env-example .env and replace the env varibles then run

   $ npm install
   $ npm start

with yours else this is primarily to work with github actions

Contributing

Of course PRs are welcomed at every level.

License

MIT license