Skip to content
arrow-right-circle

GitHub Action

Slack Send Message Clicksign

v2.1.0 Latest version

Slack Send Message Clicksign

arrow-right-circle

Slack Send Message Clicksign

Send message to slack and return thread id

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Slack Send Message Clicksign

uses: clicksign/slack-action@v2.1.0

Learn more about this action in clicksign/slack-action

Choose a version

typescript-action status

About

Action send message to slack

Create a JavaScript Action using TypeScript

Use this template to bootstrap the creation of a TypeScript action.:rocket:

This template includes compilation support, tests, a validation workflow, publishing, and versioning guidance.

If you are new, there's also a simpler introduction. See the Hello World JavaScript Action

Code in Main

First, you'll need to have a reasonably modern version of node handy. This won't work with versions older than 9, for instance.

Install the dependencies

$ yarn

Build the typescript and package it for distribution

$ npm run all

Change action.yml

The action.yml defines news inputs and output for action.

Inputs required default description
channel_id true CHANGELOG.md add channel id
payload false null add payload send message
thread_ts false null add thread id
environment true Sandbox add name environment
template true 1 template msg to slack

Example1

jobs:
  slack:
    runs-on: ubuntu-latest
    steps:
      - name: Slack Send Message
        uses: clicksign/slack-action
        with:
          channel_id: 'channelID'
          payload: 'hello world'
          thread_ts: 'threadID'
        env:
          SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}

Example2

jobs:
  slack:
    runs-on: ubuntu-latest
    steps:
      - name: Slack Send Message
        uses: clicksign/slack-action
        with:
          channel_id: 'channelID'
          template: '2'
          thread_ts: 'threadID'
        env:
          SLACK_TOKEN: ${{secrets.SLACK_TOKEN}}

Templates Default

The templates in templates-default.ts.

Template description
1 @channel Iniciado Deploy repository_name main em Sandbox
2 @channel Finalizado Deploy repository_name main em Sandbox
3 @channel Falha Deploy repository_name main em Sandbox