Giter Site home page Giter Site logo

cc-slack-action's Introduction

cc-slack-action

This GitHUb Action parses Issues for /cc slack (case insensitve parsing) and if it is found, creates a payload that can be sent to the Slack API in the working directory of Actions workflows.

This means that standalone this action is of little use. But if you combine it with another Action (such as slack_bot_action) you will be able to have your workflow ping Slack with the issue or comment URL. It works on issue creation and on any comments and will run whenever an issue or comment occurs.

Usage

This action can easily be installed via the GitHub Actions Marketplace or by referening it in your Workflow file. It can be setup in either the visual editor or text editor to suit your preferences.

Be sure to use the current latest release (tag) when referencing this Action. It is far safer to lock to a specific version for your Workflow and allows you the choice of when to upgrade.

Here is what it might look like in the text editor:

action "Check For Message" {
  uses = "krider2010/[email protected]"
  env = {
    MESSAGE_FILE = "message-for-slack.json"
  }
}

And here's the visual editor:

Visual Editor

If /cc slack is found in the new issue/comment, then this Action also returns a success response as well as creating the payload file. This allows it to be used as a decider on whether to notify slack. If there is no match found, then the Action returns a neutral status. This prevents the next Action running but does not mark the workflow as having errored.

This can be seen here in how the outcomes of runs of the workflow have been reported:

Message Found

And then when no match was found:

Message Not Found

Output

This Action allows the MESSAGE_FILE environment variable to be set to whatever you want it to be. Without any customisation it will default to slack-message.json. Knowing this is likely to be necessary for other Actions in the workflow to pick up the file and use it.

Example Output

If you hook this Action up to something that can post to Slack, you can then see this message looking similar to this (depending on the name and icon you've given the Slack Bot integration):

Slack Output

cc-slack-action's People

Contributors

krider2010 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.